{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.1准备工作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests,json\n",
    "import pandas as pd\n",
    "import geo\n",
    "wu_key = \"513aa007abc35c285a648025471ee1f1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.2地理编码\n",
    "\n",
    "> * A.结构化地址的定义： 首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。\n",
    "\n",
    "> * B.地理编码url:https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    ">> * 必填：key，address\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- GPS定位"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#### 准备数据\n",
    "中大南方_address = \"广东省广州市中山大学南方学院\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 地理编码 A-1\n",
    "address = \"广东省广州市从化区中山大学南方学院\"\n",
    "url_geo = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "params_geo = {\n",
    "    \"key\":wu_key,\n",
    "    \"address\":中大南方_address\n",
    "}\n",
    "# positional argument follows keyword argument\n",
    "# pa 一定要放在前面，keyword argument放在末尾！！！\n",
    "response = requests.get(url=url_geo,params=params_geo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<bound method Response.json of <Response [200]>>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response.json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def geocode(key,address,city=None,batch=\"false\",sig=None,output=\"json\",callback=None):  # 根据高德开放平台的api文档进行编写封装函数\n",
    "    \"\"\"将详细的结构化地址转换为高德经纬度坐标;且支持对地标性名胜景区、建筑物名称解析为高德经纬度坐标\"\"\"\n",
    "    geocode_url = 'https://restapi.amap.com/v3/geocode/geo?parameters'\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"address\":address,\n",
    "        \"city\":city,\n",
    "        \"batch\":batch,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback\n",
    "    }\n",
    "    response = requests.get(geocode_url, params=params)\n",
    "    result = r.json()['geocodes'][0]['location']\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "中大南方_location = response.json()['geocodes'][0]['location']\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.2.2逆地理编码 A-2\n",
    "\n",
    "> * B.逆地理编码url:https://restapi.amap.com/v3/geocode/regeo?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，location(经纬度坐标）\n",
    ">> * 选填：extensions（返回详细周边信息）\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "当GPS定位到一个经纬度坐标时，通过逆地理编码得到详细的结构化地址"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备 中大南方_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 逆地理编码函数\n",
    "def regeo(key,location,poitype=None,radius=1000,extensions=\"base\",batch=\"false\",roadlevel=None,sig=None,output=\"json\",callback=None,homeorcorp=0):\n",
    "    \"\"\"获得高德地图的逆地理编码;将经纬度转换为详细结构化的地址\"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"location\":location,\n",
    "        \"poitype\":poitype,\n",
    "        \"radius\":radius,\n",
    "        \"extensions\":extensions,\n",
    "        \"batch\":batch,\n",
    "        \"roadlevel\":roadlevel,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output,\n",
    "        \"callback\":callback,\n",
    "        \"homeorcorp\":homeorcorp\n",
    "        }\n",
    "    r = requests.get(url,params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "params = {\n",
    "    \"key\":wu_key,\n",
    "    \"location\":中大南方_location,\n",
    "    \"extensions\":\"all\"\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 请取出都有的道路信息 用传统的编程思维"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['博学路', '中山路', 'S29从莞深高速']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_roads_ = []\n",
    "for item in r.json()['regeocode']['roads']:\n",
    "#     print(item['name'])\n",
    "    _roads_.append(item['name'])\n",
    "_roads_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461203',\n",
       "    'location': '113.68,23.634',\n",
       "    'direction': '南',\n",
       "    'name': '博学路',\n",
       "    'distance': '156.951'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '东南',\n",
       "    'name': '中山路',\n",
       "    'distance': '343.951'},\n",
       "   {'id': '020F49F006047765',\n",
       "    'location': '113.682,23.6394',\n",
       "    'direction': '南',\n",
       "    'name': 'S29从莞深高速',\n",
       "    'distance': '807.947'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461203',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '343.951',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '东南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇中山大学南方学院',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117103000',\n",
       "   'streetNumber': {'number': '7号',\n",
       "    'location': '113.678600,23.633329',\n",
       "    'direction': '西北',\n",
       "    'distance': '109.203',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [{'area': '536585.849985',\n",
       "    'type': '141201',\n",
       "    'id': 'B00140MR9A',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'adcode': '440117',\n",
       "    'name': '中山大学南方学院',\n",
       "    'distance': '0'}],\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '中山大学南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '2.69979',\n",
       "    'tel': '020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFF2VMJ4',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号中山大学南方学院内',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院-综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '142.466',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFFTC9PH',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.193172',\n",
       "    'name': '中山大学南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '132.988',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TQKX',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '153.818',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00141TQGR',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '109.298',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B00141WQCO',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.14954',\n",
       "    'name': '中山大学南方学院教学楼8号',\n",
       "    'location': '113.680399,23.634329',\n",
       "    'distance': '225.543',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFG9IORM',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院内',\n",
       "    'poiweight': '0.287887',\n",
       "    'name': '中山大学南方学院-图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '23.6163',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0FFKP9EQJ',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '69.4077',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJKIA10',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院',\n",
       "    'poiweight': '0.191691',\n",
       "    'name': '中山大学南方学院-第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '101.294',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TRVH',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路21',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼2号',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '264.846',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKERBQZ',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.289141',\n",
       "    'name': '中山大学南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '154.082',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFKP81F4',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '政商研究院教学楼9号',\n",
       "    'location': '113.679949,23.633919',\n",
       "    'distance': '163.951',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP9ET5',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '172.86',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TR76',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路29',\n",
       "    'poiweight': '0.052819',\n",
       "    'name': '中山大学南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '297.315',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP7Q5N',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '210.76',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '南',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2号',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '251.758',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0G3ARGF5Y',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286321',\n",
       "    'name': '中山大学南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '241.753',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '263.444',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '263.674',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '275.62',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJLW0O9',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路4附近',\n",
       "    'poiweight': '0.191645',\n",
       "    'name': '中山大学南方学院西区饭堂',\n",
       "    'location': '113.676210,23.632177',\n",
       "    'distance': '316.572',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKPXMCN',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191739',\n",
       "    'name': '中山大学南方学院音乐系',\n",
       "    'location': '113.678792,23.635389',\n",
       "    'distance': '316.942',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJBZLYT',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南50米',\n",
       "    'poiweight': '0.297382',\n",
       "    'name': '铜像广场',\n",
       "    'location': '113.676921,23.634555',\n",
       "    'distance': '326.444',\n",
       "    'tel': [],\n",
       "    'type': '风景名胜;风景名胜;风景名胜'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '356.923',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKPXO2S',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.188247',\n",
       "    'name': '中山大学南方学院医务室',\n",
       "    'location': '113.679394,23.635924',\n",
       "    'distance': '372.556',\n",
       "    'tel': [],\n",
       "    'type': '医疗保健服务;医疗保健服务场所;医疗保健服务场所'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号中大南方H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '331.438',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFHHLMF8',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院明辩路2号第三饭堂',\n",
       "    'poiweight': '0.178935',\n",
       "    'name': '茗语轩餐厅',\n",
       "    'location': '113.681901,23.634495',\n",
       "    'distance': '341.332',\n",
       "    'tel': '13929501395;13533390928',\n",
       "    'type': '餐饮服务;中餐厅;中餐厅'},\n",
       "   {'id': 'B0FFLJV996',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286264',\n",
       "    'name': '保利桃花源66BLOCK',\n",
       "    'location': '113.682954,23.631008',\n",
       "    'distance': '412.208',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFKPXY26',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速公路',\n",
       "    'poiweight': '0.21826',\n",
       "    'name': '中山大学南方学院聚贤楼5号',\n",
       "    'location': '113.680265,23.636313',\n",
       "    'distance': '427.447',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;商务住宅相关;商务住宅相关'},\n",
       "   {'id': 'B0FFGXGN3K',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院',\n",
       "    'poiweight': '0.188657',\n",
       "    'name': '中山大学南方学院宿舍H25',\n",
       "    'location': '113.683474,23.632020',\n",
       "    'distance': '430.984',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>direction</th>\n",
       "      <th>businessarea</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>name</th>\n",
       "      <th>location</th>\n",
       "      <th>distance</th>\n",
       "      <th>tel</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>113.679262,23.632583</td>\n",
       "      <td>2.69979</td>\n",
       "      <td>020-61787331</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0FFF2VMJ4</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道886号中山大学南方学院内</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院-综合楼</td>\n",
       "      <td>113.680117,23.631544</td>\n",
       "      <td>142.466</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0FFFTC9PH</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.193172</td>\n",
       "      <td>中山大学南方学院教学楼10号</td>\n",
       "      <td>113.680125,23.633492</td>\n",
       "      <td>132.988</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B00141TQKX</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼6号</td>\n",
       "      <td>113.678424,23.633710</td>\n",
       "      <td>153.818</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B00141TQGR</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼7号</td>\n",
       "      <td>113.678600,23.633330</td>\n",
       "      <td>109.298</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B00141WQCO</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.14954</td>\n",
       "      <td>中山大学南方学院教学楼8号</td>\n",
       "      <td>113.680399,23.634329</td>\n",
       "      <td>225.543</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0FFG9IORM</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院内</td>\n",
       "      <td>0.287887</td>\n",
       "      <td>中山大学南方学院-图书馆</td>\n",
       "      <td>113.679177,23.632762</td>\n",
       "      <td>23.6163</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0FFKP9EQJ</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院4号实验楼</td>\n",
       "      <td>113.679963,23.632652</td>\n",
       "      <td>69.4077</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0FFJKIA10</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院</td>\n",
       "      <td>0.191691</td>\n",
       "      <td>中山大学南方学院-第11教学楼</td>\n",
       "      <td>113.680037,23.633173</td>\n",
       "      <td>101.294</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B00141TRVH</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路21</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼2号</td>\n",
       "      <td>113.677060,23.631346</td>\n",
       "      <td>264.846</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0FFKERBQZ</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7号附近</td>\n",
       "      <td>0.289141</td>\n",
       "      <td>中山大学南方学院惟贤门</td>\n",
       "      <td>113.678437,23.633721</td>\n",
       "      <td>154.082</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0FFKP81F4</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>政商研究院教学楼9号</td>\n",
       "      <td>113.679949,23.633919</td>\n",
       "      <td>163.951</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0FFKP9ET5</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院1号实验楼</td>\n",
       "      <td>113.678215,23.631370</td>\n",
       "      <td>172.86</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B00141TR76</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路29</td>\n",
       "      <td>0.052819</td>\n",
       "      <td>中山大学南方学院教学楼4号</td>\n",
       "      <td>113.677460,23.630490</td>\n",
       "      <td>297.315</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0FFKP7Q5N</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院2号实验楼</td>\n",
       "      <td>113.678211,23.630956</td>\n",
       "      <td>210.76</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B00140TWHT</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>笃行路2号</td>\n",
       "      <td>0.157653</td>\n",
       "      <td>教工住宅1号</td>\n",
       "      <td>113.678490,23.630432</td>\n",
       "      <td>251.758</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0G3ARGF5Y</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286321</td>\n",
       "      <td>中山大学南方学院教学楼1号</td>\n",
       "      <td>113.677077,23.631783</td>\n",
       "      <td>241.753</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0FFLBEOND</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.190963</td>\n",
       "      <td>聚贤楼10号</td>\n",
       "      <td>113.681253,23.631036</td>\n",
       "      <td>263.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路19号附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>263.674</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路25</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>275.62</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFJLW0O9</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路4附近</td>\n",
       "      <td>0.191645</td>\n",
       "      <td>中山大学南方学院西区饭堂</td>\n",
       "      <td>113.676210,23.632177</td>\n",
       "      <td>316.572</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0FFKPXMCN</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191739</td>\n",
       "      <td>中山大学南方学院音乐系</td>\n",
       "      <td>113.678792,23.635389</td>\n",
       "      <td>316.942</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0FFJBZLYT</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路与博学路交叉口东南50米</td>\n",
       "      <td>0.297382</td>\n",
       "      <td>铜像广场</td>\n",
       "      <td>113.676921,23.634555</td>\n",
       "      <td>326.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>风景名胜;风景名胜;风景名胜</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFG8CSEK</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.185371</td>\n",
       "      <td>L5员工宿舍</td>\n",
       "      <td>113.682583,23.631487</td>\n",
       "      <td>356.923</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0FFKPXO2S</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.188247</td>\n",
       "      <td>中山大学南方学院医务室</td>\n",
       "      <td>113.679394,23.635924</td>\n",
       "      <td>372.556</td>\n",
       "      <td>[]</td>\n",
       "      <td>医疗保健服务;医疗保健服务场所;医疗保健服务场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0FFH6K3U9</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉镇温泉大道882号中大南方H7栋1-5层</td>\n",
       "      <td>0.254885</td>\n",
       "      <td>广州中大南方招待所</td>\n",
       "      <td>113.676330,23.631332</td>\n",
       "      <td>331.438</td>\n",
       "      <td>020-61787222</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0FFHHLMF8</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院明辩路2号第三饭堂</td>\n",
       "      <td>0.178935</td>\n",
       "      <td>茗语轩餐厅</td>\n",
       "      <td>113.681901,23.634495</td>\n",
       "      <td>341.332</td>\n",
       "      <td>13929501395;13533390928</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0FFLJV996</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286264</td>\n",
       "      <td>保利桃花源66BLOCK</td>\n",
       "      <td>113.682954,23.631008</td>\n",
       "      <td>412.208</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0FFKPXY26</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速公路</td>\n",
       "      <td>0.21826</td>\n",
       "      <td>中山大学南方学院聚贤楼5号</td>\n",
       "      <td>113.680265,23.636313</td>\n",
       "      <td>427.447</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;商务住宅相关;商务住宅相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0FFGXGN3K</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>0.188657</td>\n",
       "      <td>中山大学南方学院宿舍H25</td>\n",
       "      <td>113.683474,23.632020</td>\n",
       "      <td>430.984</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id direction businessarea                 address poiweight  \\\n",
       "0   B00140MR9A         西           []                温泉大道882号  0.450402   \n",
       "1   B0FFF2VMJ4        东南           []       温泉大道886号中山大学南方学院内  0.148531   \n",
       "2   B0FFFTC9PH        东北           []         从莞深高速(中山大学南方学院)  0.193172   \n",
       "3   B00141TQKX        西北           []                 温泉大道882  0.148531   \n",
       "4   B00141TQGR        西北           []                    博学路7  0.148531   \n",
       "5   B00141WQCO        东北           []                     博学路   0.14954   \n",
       "6   B0FFG9IORM        西北           []       温泉大道882号中山大学南方学院内  0.287887   \n",
       "7   B0FFKP9EQJ         东           []                   博学路附近  0.191742   \n",
       "8   B0FFJKIA10        东北           []        温泉大道882号中山大学南方学院  0.191691   \n",
       "9   B00141TRVH        西南           []                   博学路21  0.148531   \n",
       "10  B0FFKERBQZ        西北           []                 博学路7号附近  0.289141   \n",
       "11  B0FFKP81F4        东北           []                     中山路  0.191742   \n",
       "12  B0FFKP9ET5        西南           []                   博学路附近  0.191742   \n",
       "13  B00141TR76        西南           []                   博学路29  0.052819   \n",
       "14  B0FFKP7Q5N        西南           []                     博学路  0.191742   \n",
       "15  B00140TWHT         南           []                   笃行路2号  0.157653   \n",
       "16  B0G3ARGF5Y         西           []                      []  0.286321   \n",
       "17  B0FFLBEOND        东南           []         从莞深高速(中山大学南方学院)  0.190963   \n",
       "18  B0FFKP81F0         西           []                博学路19号附近  0.191742   \n",
       "19  B0FFKP838K        西南           []                   博学路25  0.191742   \n",
       "20  B0FFJLW0O9         西           []                  博学路4附近  0.191645   \n",
       "21  B0FFKPXMCN         北           []                     中山路  0.191739   \n",
       "22  B0FFJBZLYT        西北           []         中山路与博学路交叉口东南50米  0.297382   \n",
       "23  B0FFG8CSEK         东           []         从莞深高速(中山大学南方学院)  0.185371   \n",
       "24  B0FFKPXO2S         北           []                   博学路附近  0.188247   \n",
       "25  B0FFH6K3U9        西南           []  温泉镇温泉大道882号中大南方H7栋1-5层  0.254885   \n",
       "26  B0FFHHLMF8        东北           []       中山大学南方学院明辩路2号第三饭堂  0.178935   \n",
       "27  B0FFLJV996        东南           []                      []  0.286264   \n",
       "28  B0FFKPXY26         北           []                 从莞深高速公路   0.21826   \n",
       "29  B0FFGXGN3K         东           []                中山大学南方学院  0.188657   \n",
       "\n",
       "               name              location distance                        tel  \\\n",
       "0          中山大学南方学院  113.679262,23.632583  2.69979               020-61787331   \n",
       "1      中山大学南方学院-综合楼  113.680117,23.631544  142.466                         []   \n",
       "2    中山大学南方学院教学楼10号  113.680125,23.633492  132.988                         []   \n",
       "3     中山大学南方学院教学楼6号  113.678424,23.633710  153.818                         []   \n",
       "4     中山大学南方学院教学楼7号  113.678600,23.633330  109.298                         []   \n",
       "5     中山大学南方学院教学楼8号  113.680399,23.634329  225.543                         []   \n",
       "6      中山大学南方学院-图书馆  113.679177,23.632762  23.6163  020-61787368;020-61787371   \n",
       "7     中山大学南方学院4号实验楼  113.679963,23.632652  69.4077                         []   \n",
       "8   中山大学南方学院-第11教学楼  113.680037,23.633173  101.294                         []   \n",
       "9     中山大学南方学院教学楼2号  113.677060,23.631346  264.846                         []   \n",
       "10      中山大学南方学院惟贤门  113.678437,23.633721  154.082                         []   \n",
       "11       政商研究院教学楼9号  113.679949,23.633919  163.951                         []   \n",
       "12    中山大学南方学院1号实验楼  113.678215,23.631370   172.86                         []   \n",
       "13    中山大学南方学院教学楼4号  113.677460,23.630490  297.315                         []   \n",
       "14    中山大学南方学院2号实验楼  113.678211,23.630956   210.76                         []   \n",
       "15           教工住宅1号  113.678490,23.630432  251.758                         []   \n",
       "16    中山大学南方学院教学楼1号  113.677077,23.631783  241.753                         []   \n",
       "17           聚贤楼10号  113.681253,23.631036  263.444                         []   \n",
       "18   教学楼1号(文学与传媒学院)  113.676866,23.631736  263.674                         []   \n",
       "19     教学楼3号(外国语学院)  113.677247,23.630947   275.62                         []   \n",
       "20     中山大学南方学院西区饭堂  113.676210,23.632177  316.572                         []   \n",
       "21      中山大学南方学院音乐系  113.678792,23.635389  316.942                         []   \n",
       "22             铜像广场  113.676921,23.634555  326.444                         []   \n",
       "23           L5员工宿舍  113.682583,23.631487  356.923                         []   \n",
       "24      中山大学南方学院医务室  113.679394,23.635924  372.556                         []   \n",
       "25        广州中大南方招待所  113.676330,23.631332  331.438               020-61787222   \n",
       "26            茗语轩餐厅  113.681901,23.634495  341.332    13929501395;13533390928   \n",
       "27     保利桃花源66BLOCK  113.682954,23.631008  412.208                         []   \n",
       "28    中山大学南方学院聚贤楼5号  113.680265,23.636313  427.447                         []   \n",
       "29    中山大学南方学院宿舍H25  113.683474,23.632020  430.984                         []   \n",
       "\n",
       "                        type  \n",
       "0             科教文化服务;学校;高等院校  \n",
       "1               科教文化服务;学校;学校  \n",
       "2       科教文化服务;科教文化场所;科教文化场所  \n",
       "3               科教文化服务;学校;学校  \n",
       "4             科教文化服务;学校;高等院校  \n",
       "5       科教文化服务;科教文化场所;科教文化场所  \n",
       "6             科教文化服务;图书馆;图书馆  \n",
       "7       科教文化服务;科教文化场所;科教文化场所  \n",
       "8       科教文化服务;科教文化场所;科教文化场所  \n",
       "9       科教文化服务;科教文化场所;科教文化场所  \n",
       "10            科教文化服务;学校;高等院校  \n",
       "11      科教文化服务;科教文化场所;科教文化场所  \n",
       "12      科教文化服务;科教文化场所;科教文化场所  \n",
       "13      科教文化服务;科教文化场所;科教文化场所  \n",
       "14      科教文化服务;科教文化场所;科教文化场所  \n",
       "15             商务住宅;住宅区;住宅小区  \n",
       "16            科教文化服务;学校;高等院校  \n",
       "17               商务住宅;住宅区;宿舍  \n",
       "18      科教文化服务;科教文化场所;科教文化场所  \n",
       "19      科教文化服务;科教文化场所;科教文化场所  \n",
       "20      科教文化服务;科教文化场所;科教文化场所  \n",
       "21      科教文化服务;科教文化场所;科教文化场所  \n",
       "22            风景名胜;风景名胜;风景名胜  \n",
       "23               商务住宅;住宅区;宿舍  \n",
       "24  医疗保健服务;医疗保健服务场所;医疗保健服务场所  \n",
       "25        住宿服务;住宿服务相关;住宿服务相关  \n",
       "26              餐饮服务;中餐厅;中餐厅  \n",
       "27             商务住宅;住宅区;住宅小区  \n",
       "28        商务住宅;商务住宅相关;商务住宅相关  \n",
       "29               商务住宅;住宅区;宿舍  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3路径规划\n",
    "\n",
    "> * 1、 步行\n",
    "> * 2、 公交车\n",
    "> * 3、 驾车"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3.1 步行\n",
    "> * B.url:https://restapi.amap.com/v3/direction/walking?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，origin（出发点：经纬度）,destination（目的地：经纬度）\n",
    ">> * 选填：\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 规划100KM以内的步行通勤方案\n",
    "- 返回通勤方案的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备： \n",
    "origin = \"广东省广州市中山大学南方学院\"\n",
    "destination = \"广州市从化区龙岗\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 思考：如果有1000个位置？重复代码？\n",
    "# 函数！？ -->1、节省代码，重复利用  2、可以给小白（会一点python）用！\n",
    "# 地理编码 =》 函数形式\n",
    "# 函数一定不会报错，哪怕你写的语法有错误，哪怕你写的参数没定义？-----> 函数只有在执行（调用）时才会真正意义的运行！\n",
    "\n",
    "def geocode(key,address,city=None,batch=None)->str:\n",
    "    \"\"\"获取高德API的地理编码\n",
    "    注释：key是指高德API的秘钥，请先去注册\n",
    "          address是指结构化地址，具体请查看：https://lbs.amap.com/api/webservice/guide/api/georegeo   \n",
    "    \"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"address\":address,\n",
    "        \"city\":city,\n",
    "        \"batch\":batch\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    results = response.json()['geocodes'][0]['location']\n",
    "    # 返回值\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function geocode in module __main__:\n",
      "\n",
      "geocode(key, address, city=None, batch=None) -> str\n",
      "    获取高德API的地理编码\n",
      "    注释：key是指高德API的秘钥，请先去注册\n",
      "          address是指结构化地址，具体请查看：https://lbs.amap.com/api/webservice/guide/api/georegeo\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geocode)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "起始点_中大南方 = geocode(wu_key,origin)\n",
    "起始点_中大南方"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.668051,23.600869'"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "目的地_龙岗 = geocode(wu_key,destination)\n",
    "目的地_龙岗"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步行\n",
    "url = \"https://restapi.amap.com/v3/direction/walking?parameters\"\n",
    "params = {\n",
    "    \"key\":wu_key,\n",
    "    \"origin\":起始点_中大南方,\n",
    "    \"destination\":目的地_龙岗\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'distance': '4957',\n",
       "  'duration': '3966',\n",
       "  'steps': [{'instruction': '向东步行101米右转',\n",
       "    'orientation': '东',\n",
       "    'road': [],\n",
       "    'distance': '101',\n",
       "    'duration': '81',\n",
       "    'polyline': '113.679592,23.632491;113.680586,23.632522',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行199米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '199',\n",
       "    'duration': '159',\n",
       "    'polyline': '113.680586,23.632522;113.680638,23.63214;113.680668,23.63174;113.680634,23.631541;113.68059,23.631437;113.68059,23.631437;113.680499,23.631241;113.680408,23.631094;113.680208,23.630842',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西步行159米左转',\n",
       "    'orientation': '西',\n",
       "    'road': [],\n",
       "    'distance': '159',\n",
       "    'duration': '127',\n",
       "    'polyline': '113.680204,23.630838;113.680035,23.630773;113.680035,23.630773;113.679644,23.630638;113.679644,23.630638;113.679362,23.630521;113.679201,23.630473;113.679201,23.630473;113.679032,23.63043;113.679032,23.63043;113.67888,23.630404;113.67888,23.630404;113.678711,23.630365',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行237米左转',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '237',\n",
       "    'duration': '190',\n",
       "    'polyline': '113.678711,23.63036;113.678711,23.62934;113.678711,23.62934;113.678711,23.629193;113.678689,23.629084;113.678637,23.629023;113.678424,23.628902;113.678368,23.628841;113.678316,23.628724;113.678294,23.628611;113.678294,23.628611;113.678277,23.628372',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行498米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '498',\n",
       "    'duration': '398',\n",
       "    'polyline': '113.678273,23.628368;113.678572,23.628338;113.678685,23.628307;113.678685,23.628307;113.678845,23.628234;113.679045,23.628073;113.679158,23.627964;113.679158,23.627964;113.679214,23.627869;113.679236,23.627778;113.67928,23.627526;113.679288,23.627322;113.679288,23.627322;113.679253,23.626853;113.679184,23.626623;113.679141,23.626497;113.679002,23.626259;113.678941,23.626176;113.678711,23.625977;113.67862,23.625864;113.678529,23.62572;113.678438,23.625191;113.678429,23.625056;113.678451,23.624939;113.678572,23.624657',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西南步行722米左转',\n",
       "    'orientation': '西南',\n",
       "    'road': [],\n",
       "    'distance': '722',\n",
       "    'duration': '578',\n",
       "    'polyline': '113.678572,23.624653;113.678559,23.62451;113.678416,23.624323;113.678416,23.624323;113.677582,23.623793;113.676532,23.623346;113.676363,23.623255;113.676272,23.623151;113.676111,23.622834;113.676042,23.622739;113.67579,23.622483;113.675499,23.622279;113.675417,23.622174;113.675386,23.622088;113.675378,23.621836;113.675378,23.621836;113.675391,23.62161;113.675434,23.621476;113.675543,23.621359;113.675764,23.621181;113.675846,23.621089;113.675903,23.620994;113.675907,23.620855;113.675877,23.620725;113.675747,23.620547;113.675599,23.620373;113.675243,23.620013',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向东南步行412米向右前方行走',\n",
       "    'orientation': '东南',\n",
       "    'road': [],\n",
       "    'distance': '412',\n",
       "    'duration': '330',\n",
       "    'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619991;113.675773,23.619948;113.676016,23.619796;113.676901,23.619193;113.677261,23.618785;113.678069,23.61783;113.678069,23.61783;113.678181,23.617656',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向南步行1381米右转',\n",
       "    'orientation': '南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '1381',\n",
       "    'duration': '1105',\n",
       "    'polyline': '113.678181,23.617652;113.678095,23.617205;113.678051,23.617075;113.677973,23.616923;113.677743,23.616558;113.677609,23.616289;113.677391,23.615816;113.677339,23.615668;113.67714,23.614826;113.677049,23.614323;113.676927,23.613359;113.676845,23.612786;113.676602,23.611489;113.676415,23.610438;113.676411,23.610265;113.676411,23.610265;113.676489,23.609848;113.676502,23.609622;113.676493,23.609236;113.676415,23.608746;113.676415,23.608485;113.67648,23.60819;113.67661,23.607734;113.676819,23.606736;113.676862,23.606541;113.676914,23.606415;113.677014,23.606254;113.677535,23.605673',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向西南步行165米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '165',\n",
       "    'duration': '132',\n",
       "    'polyline': '113.677535,23.605668;113.676988,23.605373;113.676402,23.605;113.676163,23.604887',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿934县道向西步行118米直行',\n",
       "    'orientation': '西',\n",
       "    'road': '934县道',\n",
       "    'distance': '118',\n",
       "    'duration': '94',\n",
       "    'polyline': '113.676159,23.604883;113.675799,23.604805;113.675508,23.604779;113.675508,23.604779;113.675013,23.60474',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行674米向右前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '674',\n",
       "    'duration': '539',\n",
       "    'polyline': '113.675009,23.604735;113.674236,23.604683;113.673893,23.604618;113.673464,23.604492;113.673464,23.604492;113.67168,23.604006;113.671541,23.603958;113.671411,23.603854;113.671068,23.603472;113.670807,23.603264;113.670807,23.603264;113.670525,23.603073;113.6702,23.602904;113.6702,23.602904;113.670022,23.602795;113.670022,23.602795;113.669909,23.602682;113.669818,23.602517;113.669787,23.602413;113.669718,23.601901',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行247米右转',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '247',\n",
       "    'duration': '198',\n",
       "    'polyline': '113.669714,23.601897;113.66964,23.601771;113.66964,23.601771;113.669488,23.601558;113.669488,23.601558;113.668789,23.600859;113.668663,23.600768;113.668663,23.600768;113.668442,23.600647;113.667947,23.600417',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿龙泉路向北步行44米到达目的地',\n",
       "    'orientation': '北',\n",
       "    'road': '龙泉路',\n",
       "    'distance': '44',\n",
       "    'duration': '35',\n",
       "    'polyline': '113.667943,23.600412;113.667812,23.600794',\n",
       "    'action': [],\n",
       "    'assistant_action': '到达目的地',\n",
       "    'walk_type': '0'}]}]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()['route']['paths']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3.2 公交\n",
    "> * B.bus_url:https://restapi.amap.com/v3/direction/transit/integrated?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，origin（出发点：经纬度）,destination（目的地：经纬度），city\n",
    ">> * 选填：extensions（可选值：base(default)/all），strategy\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 应用于打车软件\n",
    "- 规划综合各类公共（火车、公交、地铁）交通方式的通勤方案，并且返回通勤方案的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备\n",
    "wu_key = \"513aa007abc35c285a648025471ee1f1\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "origin = \"暨南大学\"\n",
    "destination = \"广州塔\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "def bus(key,origin,destination,city):\n",
    "    bus_url = \"https://restapi.amap.com/v3/direction/transit/integrated?parameters\"\n",
    "    params ={\n",
    "        \"key\":key,\n",
    "        \"origin\":origin,\n",
    "        \"destination\":destination,\n",
    "        \"city\":city\n",
    "    }\n",
    "    r = requests.get(bus_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "113.350961,23.131577\n",
      "113.336127,23.113409\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '5',\n",
       " 'route': {'origin': '113.350961,23.131577',\n",
       "  'destination': '113.336127,23.113409',\n",
       "  'distance': '3224',\n",
       "  'taxi_cost': '14',\n",
       "  'transits': [{'cost': '1.0',\n",
       "    'duration': '3078',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '1408',\n",
       "    'distance': '4611',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.345055,23.125912',\n",
       "       'distance': '1225',\n",
       "       'duration': '1050',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行67米向右前方行走',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '67',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行125米左转',\n",
       "         'road': [],\n",
       "         'distance': '125',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347214,23.126137;113.347214,23.126160;113.346947,23.126177;113.346901,23.125681;113.346588,23.125698;113.346596,23.125776',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行155米到达国防大厦',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '155',\n",
       "         'duration': [],\n",
       "         'polyline': '113.346596,23.125772;113.346306,23.125793;113.346100,23.125816;113.345978,23.125834;113.345726,23.125860;113.345055,23.125912',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达国防大厦'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '国防大厦',\n",
       "          'id': '900000105872002',\n",
       "          'location': '113.344963,23.125919'},\n",
       "         'arrival_stop': {'name': '猎德码头',\n",
       "          'id': '900000105872006',\n",
       "          'location': '113.337082,23.112673'},\n",
       "         'name': '669路(金穗路总站(马场路口)--金穗路总站(马场路口))',\n",
       "         'id': '900000105872',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '3203',\n",
       "         'duration': '1872',\n",
       "         'polyline': '113.344963,23.125919;113.344961,23.125920;113.345725,23.125859;113.345977,23.125833;113.346102,23.125816;113.346306,23.125794;113.347248,23.125738;113.347444,23.125768;113.347708,23.125738;113.348134,23.125673;113.348650,23.125595;113.348906,23.125408;113.349297,23.125321;113.349839,23.125200;113.349718,23.124605;113.349596,23.124162;113.349510,23.123837;113.349510,23.123832;113.349384,23.123368;113.348611,23.120503;113.348533,23.120226;113.348537,23.120230;113.348534,23.120235;113.348534,23.120232;113.348198,23.118980;113.348000,23.118338;113.347816,23.117743;113.347725,23.117605;113.347633,23.117527;113.347450,23.117386;113.347382,23.117395;113.347153,23.117418;113.346390,23.117496;113.346389,23.117496;113.346124,23.117522;113.344839,23.117609;113.344674,23.117622;113.344132,23.117648;113.343767,23.117661;113.343459,23.117682;113.343268,23.117422;113.343264,23.117179;113.343268,23.117010;113.343260,23.115990;113.343242,23.115239;113.343229,23.114661;113.343216,23.113763;113.343203,23.113307;113.343186,23.112313;113.343095,23.112092;113.342947,23.111953;113.342856,23.111918;113.342522,23.111962;113.342066,23.112031;113.341801,23.112070;113.341805,23.112072;113.341141,23.112171;113.340675,23.112226;113.338737,23.112469;113.338371,23.112513;113.337975,23.112560;113.337082,23.112673',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '5',\n",
       "         'via_stops': [{'name': '跑马地花园',\n",
       "           'id': '900000105872016',\n",
       "           'location': '113.349510,23.123837'},\n",
       "          {'name': '骏逸苑',\n",
       "           'id': '900000105872003',\n",
       "           'location': '113.348533,23.120226'},\n",
       "          {'name': '花城大道',\n",
       "           'id': '900000105872004',\n",
       "           'location': '113.346390,23.117496'},\n",
       "          {'name': '马场路南',\n",
       "           'id': '900000105872015',\n",
       "           'location': '113.343242,23.115239'},\n",
       "          {'name': '临江大道东',\n",
       "           'id': '900000105872005',\n",
       "           'location': '113.341801,23.112070'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.337013,23.112679',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '183',\n",
       "       'duration': '156',\n",
       "       'steps': [{'instruction': '沿临江大道步行62米右转',\n",
       "         'road': '临江大道',\n",
       "         'distance': '62',\n",
       "         'duration': [],\n",
       "         'polyline': '113.337013,23.112679;113.336601,23.112730;113.336403,23.112764',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行83米左转',\n",
       "         'road': '海文路',\n",
       "         'distance': '83',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336403,23.112764;113.336441,23.113173;113.336418,23.113516',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '2678',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '1875',\n",
       "    'distance': '3660',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.343330,23.123077',\n",
       "       'distance': '1692',\n",
       "       'duration': '1450',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行448米左转',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '448',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137;113.346855,23.126163;113.346703,23.126177;113.346245,23.126198;113.345619,23.126232;113.344688,23.126293;113.344040,23.126341;113.343880,23.126354;113.343674,23.126375;113.343460,23.126389',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿马场路步行366米到达红线女中心',\n",
       "         'road': '马场路',\n",
       "         'distance': '366',\n",
       "         'duration': [],\n",
       "         'polyline': '113.343460,23.126389;113.343376,23.126038;113.343376,23.125919;113.343361,23.125494;113.343353,23.125139;113.343346,23.124201;113.343346,23.123955;113.343346,23.123476;113.343330,23.123077',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达红线女中心'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '红线女中心',\n",
       "          'id': '440100016237010',\n",
       "          'location': '113.343323,23.123074'},\n",
       "         'arrival_stop': {'name': '猎德码头',\n",
       "          'id': '440100016237014',\n",
       "          'location': '113.337013,23.112682'},\n",
       "         'name': '138路(东莞庄总站--五羊新城总站)',\n",
       "         'id': '440100016237',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '1785',\n",
       "         'duration': '1071',\n",
       "         'polyline': '113.343323,23.123074;113.343323,23.122465;113.343323,23.122135;113.343323,23.121876;113.343323,23.121498;113.343346,23.121321;113.343346,23.120838;113.343315,23.119480;113.343315,23.119381;113.343300,23.118837;113.343300,23.118729;113.343300,23.118732;113.343300,23.118729;113.343300,23.118616;113.343300,23.118425;113.343292,23.117977;113.343277,23.117701;113.343269,23.117422;113.343269,23.117178;113.343269,23.117008;113.343262,23.115990;113.343246,23.115242;113.343246,23.115238;113.343224,23.114662;113.343216,23.113762;113.343201,23.113306;113.343193,23.112373;113.343117,23.112127;113.343063,23.112062;113.342949,23.111954;113.342865,23.111908;113.342339,23.111992;113.342064,23.112032;113.341805,23.112072;113.341141,23.112171;113.340675,23.112226;113.338737,23.112469;113.338371,23.112513;113.337975,23.112560;113.337013,23.112682',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '3',\n",
       "         'via_stops': [{'name': '马场路中',\n",
       "           'id': '440100016237011',\n",
       "           'location': '113.343300,23.118729'},\n",
       "          {'name': '马场路南',\n",
       "           'id': '440100016237022',\n",
       "           'location': '113.343246,23.115242'},\n",
       "          {'name': '临江大道东',\n",
       "           'id': '440100016237013',\n",
       "           'location': '113.341805,23.112072'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.337013,23.112679',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '183',\n",
       "       'duration': '156',\n",
       "       'steps': [{'instruction': '沿临江大道步行62米右转',\n",
       "         'road': '临江大道',\n",
       "         'distance': '62',\n",
       "         'duration': [],\n",
       "         'polyline': '113.337013,23.112679;113.336601,23.112730;113.336403,23.112764',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行83米左转',\n",
       "         'road': '海文路',\n",
       "         'distance': '83',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336403,23.112764;113.336441,23.113173;113.336418,23.113516',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '3.0',\n",
       "    'duration': '2915',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2878',\n",
       "    'distance': '7016',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.339600,23.134882',\n",
       "       'distance': '1705',\n",
       "       'duration': '1461',\n",
       "       'steps': [{'instruction': '沿明湖南路步行35米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '35',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351357,23.131479',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行219米向右前方行走',\n",
       "         'road': '真如东路',\n",
       "         'distance': '219',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351357,23.131479;113.351288,23.132196;113.351280,23.132383;113.351265,23.132973;113.351242,23.133142;113.351219,23.133255;113.351105,23.133425',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行311米右转',\n",
       "         'road': '真如东路',\n",
       "         'distance': '311',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351105,23.133425;113.351105,23.133646;113.350967,23.134319;113.350739,23.135208;113.350723,23.135242;113.350685,23.135265;113.350037,23.135382;113.349899,23.135382;113.349792,23.135382;113.349709,23.135386',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行25米左转',\n",
       "         'road': [],\n",
       "         'distance': '25',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349709,23.135386;113.349724,23.135477;113.349762,23.135612',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山大道西辅路步行48米往前走',\n",
       "         'road': '中山大道西辅路',\n",
       "         'distance': '48',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349762,23.135612;113.349297,23.135685',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山大道西步行389米往前走',\n",
       "         'road': '中山大道西',\n",
       "         'distance': '389',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349289,23.135685;113.347931,23.135933;113.347603,23.135994;113.347290,23.136055;113.347237,23.136068;113.346786,23.136150;113.345551,23.136272',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿天河路辅路步行510米左转',\n",
       "         'road': '天河路辅路',\n",
       "         'distance': '510',\n",
       "         'duration': [],\n",
       "         'polyline': '113.345543,23.136272;113.345161,23.136219;113.344955,23.136181;113.344780,23.136147;113.343987,23.135981;113.343697,23.135916;113.343346,23.135841;113.342941,23.135756;113.342758,23.135715;113.342560,23.135668;113.342316,23.135612;113.342033,23.135538;113.341805,23.135481;113.341431,23.135395;113.340897,23.135260;113.340675,23.135187;113.340637,23.135170',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行168米到达岗顶',\n",
       "         'road': [],\n",
       "         'distance': '168',\n",
       "         'duration': [],\n",
       "         'polyline': '113.340630,23.135174;113.340607,23.134878;113.340248,23.134731;113.340080,23.135078;113.339600,23.134882',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达岗顶'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '岗顶',\n",
       "          'id': '440100023034005',\n",
       "          'location': '113.339601,23.134880'},\n",
       "         'arrival_stop': {'name': '珠江新城',\n",
       "          'id': '440100023034008',\n",
       "          'location': '113.321206,23.119293'},\n",
       "         'name': '地铁3号线(天河客运站--番禺广场)',\n",
       "         'id': '440100023034',\n",
       "         'type': '地铁线路',\n",
       "         'distance': '3158',\n",
       "         'duration': '316',\n",
       "         'polyline': '113.339601,23.134880;113.338709,23.134517;113.338282,23.134328;113.338056,23.134226;113.337864,23.134149;113.337673,23.134069;113.337473,23.134001;113.337212,23.133924;113.336968,23.133861;113.336742,23.133806;113.336464,23.133743;113.335455,23.133493;113.334924,23.133353;113.334733,23.133305;113.334585,23.133277;113.334305,23.133216;113.333834,23.133138;113.333091,23.133116;113.332124,23.133135;113.331184,23.133151;113.330589,23.133198;113.328752,23.133418;113.328183,23.133479;113.327289,23.133514;113.326354,23.133514;113.325081,23.133547;113.324429,23.133601;113.323537,23.133645;113.322613,23.133645;113.322308,23.133591;113.321994,23.133405;113.321558,23.132971;113.321548,23.132550;113.321503,23.131138;113.321456,23.129680;113.321411,23.128625;113.321320,23.127081;113.321280,23.124987;113.321239,23.122875;113.321210,23.120814;113.321206,23.119293',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0610',\n",
       "         'end_time': '2330',\n",
       "         'via_num': '2',\n",
       "         'via_stops': [{'name': '石牌桥',\n",
       "           'id': '440100023034006',\n",
       "           'location': '113.332124,23.133135'},\n",
       "          {'name': '体育西路',\n",
       "           'id': '440100023034007',\n",
       "           'location': '113.321503,23.131138'}]}]},\n",
       "      'entrance': {'name': 'D口', 'location': '113.340599,23.134874'},\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': [],\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '珠江新城',\n",
       "          'id': '440100023037014',\n",
       "          'location': '113.321206,23.119293'},\n",
       "         'arrival_stop': {'name': '猎德',\n",
       "          'id': '440100023037015',\n",
       "          'location': '113.332105,23.118539'},\n",
       "         'name': '地铁5号线(滘口--文冲)',\n",
       "         'id': '440100023037',\n",
       "         'type': '地铁线路',\n",
       "         'distance': '980',\n",
       "         'duration': '133',\n",
       "         'polyline': '113.321206,23.119293;113.322586,23.119290;113.324445,23.119121;113.326668,23.118952;113.329169,23.118750;113.331498,23.118582;113.332105,23.118539',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0615',\n",
       "         'end_time': '2315',\n",
       "         'via_num': '0',\n",
       "         'via_stops': []}]},\n",
       "      'entrance': [],\n",
       "      'exit': {'name': 'B口', 'location': '113.332726,23.118099'},\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.332100,23.118532',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '1172',\n",
       "       'duration': '1004',\n",
       "       'steps': [{'instruction': '步行151米右转',\n",
       "         'road': [],\n",
       "         'distance': '151',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332100,23.118532;113.332779,23.118494;113.332809,23.118494;113.332779,23.118095;113.332726,23.118099;113.332695,23.118359',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿花城大道步行22米向右前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '22',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332687,23.118359;113.332909,23.118347',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行79米向右前方行走',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '79',\n",
       "         'duration': [],\n",
       "         'polyline': '113.332909,23.118341;113.333267,23.118065;113.333488,23.117851',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行298米右转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '298',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333488,23.117847;113.333519,23.117331;113.333519,23.117266;113.333534,23.116875;113.333542,23.116472;113.333549,23.116064;113.333557,23.115938;113.333580,23.115339;113.333588,23.115129',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行25米向右前方行走',\n",
       "         'road': [],\n",
       "         'distance': '25',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333580,23.115126;113.333488,23.115126;113.333488,23.115269',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行81米右转',\n",
       "         'road': [],\n",
       "         'distance': '81',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333488,23.115269;113.334015,23.115820',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行32米往前走',\n",
       "         'road': [],\n",
       "         'distance': '32',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334015,23.115820;113.334076,23.115639;113.334122,23.115561',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行10米右转',\n",
       "         'road': [],\n",
       "         'distance': '10',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334122,23.115555;113.334198,23.115490',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行10米右转',\n",
       "         'road': [],\n",
       "         'distance': '10',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334198,23.115486;113.334282,23.115435',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行109米左转',\n",
       "         'road': [],\n",
       "         'distance': '109',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334282,23.115429;113.334244,23.115152;113.334145,23.114449',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海月路步行230米右转',\n",
       "         'road': '海月路',\n",
       "         'distance': '230',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334137,23.114445;113.334671,23.114445;113.335442,23.114445;113.335617,23.114435;113.336395,23.114305',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行87米右转',\n",
       "         'road': '海文路',\n",
       "         'distance': '87',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336395,23.114302;113.336395,23.114050;113.336418,23.113520',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '3034',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2143',\n",
       "    'distance': '4705',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.345055,23.125912',\n",
       "       'distance': '1225',\n",
       "       'duration': '1050',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米右转',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿忠信路步行164米左转',\n",
       "         'road': '忠信路',\n",
       "         'distance': '164',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349144,23.127136;113.348541,23.127123;113.347977,23.127117',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行115米右转',\n",
       "         'road': [],\n",
       "         'distance': '115',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347977,23.127113;113.347954,23.126619;113.347946,23.126467;113.347878,23.126076',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行67米向右前方行走',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '67',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347870,23.126072;113.347603,23.126112;113.347534,23.126116;113.347221,23.126137',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行125米左转',\n",
       "         'road': [],\n",
       "         'distance': '125',\n",
       "         'duration': [],\n",
       "         'polyline': '113.347214,23.126137;113.347214,23.126160;113.346947,23.126177;113.346901,23.125681;113.346588,23.125698;113.346596,23.125776',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿黄埔大道西步行155米到达国防大厦',\n",
       "         'road': '黄埔大道西',\n",
       "         'distance': '155',\n",
       "         'duration': [],\n",
       "         'polyline': '113.346596,23.125772;113.346306,23.125793;113.346100,23.125816;113.345978,23.125834;113.345726,23.125860;113.345055,23.125912',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达国防大厦'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '国防大厦',\n",
       "          'id': '440100016838024',\n",
       "          'location': '113.344961,23.125920'},\n",
       "         'arrival_stop': {'name': '珠江新城总站',\n",
       "          'id': '440100016838027',\n",
       "          'location': '113.341133,23.116398'},\n",
       "         'name': '545路(泽德花苑总站--珠江新城总站)',\n",
       "         'id': '440100016838',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '2562',\n",
       "         'duration': '1198',\n",
       "         'polyline': '113.344961,23.125920;113.344963,23.125919;113.344961,23.125920;113.345725,23.125859;113.345977,23.125833;113.346102,23.125816;113.346306,23.125794;113.347248,23.125738;113.347444,23.125768;113.347708,23.125738;113.348134,23.125673;113.348650,23.125595;113.348906,23.125408;113.349297,23.125321;113.349839,23.125200;113.349718,23.124605;113.349596,23.124162;113.349505,23.123824;113.349505,23.123819;113.349384,23.123368;113.348611,23.120503;113.348533,23.120226;113.348533,23.120221;113.348194,23.118980;113.347999,23.118338;113.347808,23.117704;113.347708,23.117609;113.347517,23.117474;113.347374,23.117396;113.347096,23.117426;113.346862,23.117444;113.346450,23.117487;113.345981,23.117535;113.344839,23.117609;113.344674,23.117622;113.344132,23.117648;113.343767,23.117661;113.343459,23.117682;113.343268,23.117422;113.343264,23.117179;113.343268,23.117010;113.343260,23.115990;113.343242,23.115234;113.343229,23.114661;113.342196,23.114753;113.341319,23.114835;113.340911,23.114887;113.340890,23.115234;113.340859,23.115968;113.341194,23.115985;113.341150,23.116359;113.341133,23.116398',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0600',\n",
       "         'end_time': '2230',\n",
       "         'via_num': '3',\n",
       "         'via_stops': [{'name': '跑马地花园',\n",
       "           'id': '440100016838044',\n",
       "           'location': '113.349505,23.123824'},\n",
       "          {'name': '骏逸苑',\n",
       "           'id': '440100016838025',\n",
       "           'location': '113.348533,23.120226'},\n",
       "          {'name': '花城大道',\n",
       "           'id': '440100016838040',\n",
       "           'location': '113.346450,23.117487'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.341148,23.116323',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '918',\n",
       "       'duration': '786',\n",
       "       'steps': [{'instruction': '步行37米右转',\n",
       "         'road': [],\n",
       "         'distance': '37',\n",
       "         'duration': [],\n",
       "         'polyline': '113.341148,23.116323;113.341194,23.115990',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海明路步行500米左转',\n",
       "         'road': '海明路',\n",
       "         'distance': '500',\n",
       "         'duration': [],\n",
       "         'polyline': '113.341194,23.115986;113.340858,23.115973;113.340790,23.115973;113.340416,23.115976;113.339798,23.116058;113.339691,23.116076;113.338829,23.116177;113.338509,23.116220;113.338432,23.116228;113.337990,23.116316;113.337425,23.116442;113.337013,23.116524;113.336449,23.116632;113.336304,23.116632',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海文路步行343米右转',\n",
       "         'road': '海文路',\n",
       "         'distance': '343',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336304,23.116632;113.336327,23.116116;113.336365,23.115595;113.336365,23.115282;113.336372,23.114679;113.336395,23.114305;113.336395,23.114050;113.336418,23.113520',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行17米左转',\n",
       "         'road': [],\n",
       "         'distance': '17',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336418,23.113516;113.336327,23.113554;113.336258,23.113581',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '2.0',\n",
       "    'duration': '3418',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2056',\n",
       "    'distance': '5880',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.351013,23.131449',\n",
       "       'destination': '113.351860,23.125507',\n",
       "       'distance': '1045',\n",
       "       'duration': '895',\n",
       "       'steps': [{'instruction': '沿明湖南路步行143米左转',\n",
       "         'road': '明湖南路',\n",
       "         'distance': '143',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351013,23.131449;113.351013,23.131449;113.350510,23.131393;113.350166,23.131359;113.349617,23.131298',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真茹路步行456米往前走',\n",
       "         'road': '真茹路',\n",
       "         'distance': '456',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349617,23.131294;113.349609,23.131102;113.349594,23.130243;113.349594,23.129940;113.349602,23.129696;113.349617,23.128382;113.349609,23.128311;113.349617,23.128256;113.349602,23.127144',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如路步行132米左转',\n",
       "         'road': '真如路',\n",
       "         'distance': '132',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349602,23.127140;113.349609,23.127052;113.349617,23.127005;113.349625,23.126862;113.349655,23.126518;113.349678,23.126249;113.349693,23.126106;113.349693,23.126059;113.349709,23.125929',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿真如东路步行165米右转',\n",
       "         'road': '真如东路',\n",
       "         'distance': '165',\n",
       "         'duration': [],\n",
       "         'polyline': '113.349709,23.125925;113.350487,23.125790;113.350983,23.125769;113.351112,23.125803;113.351181,23.125841;113.351288,23.125908',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行69米往前走',\n",
       "         'road': [],\n",
       "         'distance': '69',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351288,23.125902;113.351341,23.125820;113.351486,23.125967;113.351601,23.125769;113.351715,23.125793',\n",
       "         'action': '往前走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行59米右转',\n",
       "         'road': [],\n",
       "         'distance': '59',\n",
       "         'duration': [],\n",
       "         'polyline': '113.351715,23.125793;113.351852,23.125813;113.351936,23.125799;113.351967,23.125772;113.352028,23.125729;113.352043,23.125687;113.352066,23.125517',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米到达华侨医院(潭村)',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.352066,23.125513;113.351860,23.125507',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达华侨医院(潭村)'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '华侨医院(潭村)',\n",
       "          'id': '440100016909035',\n",
       "          'location': '113.351713,23.125436'},\n",
       "         'arrival_stop': {'name': '猎德东',\n",
       "          'id': '440100016909014',\n",
       "          'location': '113.331558,23.118460'},\n",
       "         'name': '583路(员村一横路总站--芳村西塱总站)',\n",
       "         'id': '440100016909',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '3824',\n",
       "         'duration': '1656',\n",
       "         'polyline': '113.351713,23.125436;113.351562,23.125319;113.351051,23.125387;113.350380,23.125525;113.348694,23.125820;113.348137,23.125938;113.347801,23.125998;113.347450,23.126015;113.347298,23.126011;113.346436,23.126080;113.346230,23.126215;113.346016,23.126221;113.345619,23.126234;113.344696,23.126293;113.344032,23.126343;113.343956,23.126347;113.343887,23.126354;113.343674,23.126375;113.343460,23.126389;113.343292,23.126406;113.343117,23.126415;113.342972,23.126425;113.342819,23.126431;113.342323,23.126467;113.341743,23.126507;113.341522,23.126520;113.340981,23.126549;113.340614,23.126549;113.340424,23.126524;113.339592,23.126585;113.339470,23.126593;113.338676,23.126657;113.338058,23.126684;113.337997,23.126694;113.337830,23.126694;113.337746,23.126766;113.337410,23.126793;113.336723,23.126844;113.336571,23.126858;113.335106,23.126966;113.334961,23.126976;113.334282,23.127014;113.334152,23.127022;113.333939,23.127035;113.333717,23.127045;113.333557,23.127001;113.333443,23.126953;113.333244,23.126808;113.333176,23.126722;113.333168,23.126398;113.333168,23.126221;113.333191,23.125843;113.333229,23.125433;113.333244,23.124969;113.333275,23.124340;113.333397,23.124149;113.333397,23.123671;113.333344,23.123537;113.333336,23.123329;113.333336,23.123274;113.333298,23.123116;113.333244,23.123043;113.333122,23.122978;113.332886,23.122965;113.331841,23.123043;113.330780,23.123129;113.330536,23.123152;113.330421,23.123159;113.330193,23.123125;113.329697,23.123165;113.329376,23.123196;113.328613,23.123251;113.328178,23.123363;113.327850,23.123091;113.327904,23.122473;113.327904,23.122177;113.327904,23.121723;113.327858,23.121151;113.327858,23.120970;113.327843,23.119867;113.327843,23.119427;113.327843,23.119328;113.327715,23.119145;113.327628,23.119062;113.327576,23.118971;113.327492,23.119040;113.326553,23.119089;113.326347,23.119112;113.326137,23.119121;113.326094,23.119103;113.326042,23.119041;113.326050,23.118849;113.326416,23.118816;113.326782,23.118784;113.327469,23.118725;113.327827,23.118752;113.328087,23.118729;113.328453,23.118706;113.329308,23.118647;113.329674,23.118616;113.330666,23.118538;113.330734,23.118534;113.331558,23.118460',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0630',\n",
       "         'end_time': '2200',\n",
       "         'via_num': '6',\n",
       "         'via_stops': [{'name': '国防大厦',\n",
       "           'id': '440100016909008',\n",
       "           'location': '113.341743,23.126507'},\n",
       "          {'name': '石牌村',\n",
       "           'id': '440100016909009',\n",
       "           'location': '113.339592,23.126585'},\n",
       "          {'name': '猎德大道北',\n",
       "           'id': '440100016909042',\n",
       "           'location': '113.333336,23.123329'},\n",
       "          {'name': '金穗路',\n",
       "           'id': '440100016909011',\n",
       "           'location': '113.329697,23.123165'},\n",
       "          {'name': '冼村路中',\n",
       "           'id': '440100016909012',\n",
       "           'location': '113.327843,23.119867'},\n",
       "          {'name': '猎德',\n",
       "           'id': '440100016909013',\n",
       "           'location': '113.329674,23.118616'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.331665,23.118454',\n",
       "       'destination': '113.336212,23.113394',\n",
       "       'distance': '1011',\n",
       "       'duration': '866',\n",
       "       'steps': [{'instruction': '沿花城大道步行246米向右前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '246',\n",
       "         'duration': [],\n",
       "         'polyline': '113.331665,23.118454;113.331879,23.118437;113.332687,23.118364;113.332909,23.118347;113.333267,23.118065;113.333267,23.118065;113.333473,23.118280;113.333885,23.118259',\n",
       "         'action': '向右前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行31米右转',\n",
       "         'road': [],\n",
       "         'distance': '31',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333885,23.118256;113.334099,23.118055',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿花城大道步行29米向左前方行走',\n",
       "         'road': '花城大道',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.334099,23.118052;113.334068,23.118025;113.333900,23.117851',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿猎德大道步行375米左转',\n",
       "         'road': '猎德大道',\n",
       "         'distance': '375',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333900,23.117847;113.333916,23.117365;113.333931,23.116741;113.333939,23.116358;113.333969,23.115152;113.333969,23.114449',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿海月路步行167米右转',\n",
       "         'road': '海月路',\n",
       "         'distance': '167',\n",
       "         'duration': [],\n",
       "         'polyline': '113.333969,23.114445;113.334137,23.114445;113.334671,23.114445;113.335442,23.114445;113.335617,23.114435',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行64米向左前方行走',\n",
       "         'road': [],\n",
       "         'distance': '64',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335617,23.114431;113.335609,23.114105;113.335571,23.113850',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行78米右转',\n",
       "         'road': [],\n",
       "         'distance': '78',\n",
       "         'duration': [],\n",
       "         'polyline': '113.335571,23.113846;113.335602,23.113794;113.335678,23.113750;113.336151,23.113628;113.336258,23.113585',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行21米',\n",
       "         'road': [],\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.336258,23.113581;113.336212,23.113394',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]}]}}"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin = \"广东省广州市暨南大学\"\n",
    "location_orgin = geocode(wu_key,origin)\n",
    "print(location_orgin)\n",
    "destination = \"广东省广州市猎德\"\n",
    "location_destination = geocode(wu_key,destination)\n",
    "print(location_destination)\n",
    "city = \"广州\" \n",
    "results_bus =  bus(wu_key,location_orgin,location_destination,city)\n",
    "results_bus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>type</th>\n",
       "      <th>distance</th>\n",
       "      <th>duration</th>\n",
       "      <th>polyline</th>\n",
       "      <th>bustimetag</th>\n",
       "      <th>start_time</th>\n",
       "      <th>end_time</th>\n",
       "      <th>via_num</th>\n",
       "      <th>via_stops</th>\n",
       "      <th>departure_stop.name</th>\n",
       "      <th>departure_stop.id</th>\n",
       "      <th>departure_stop.location</th>\n",
       "      <th>arrival_stop.name</th>\n",
       "      <th>arrival_stop.id</th>\n",
       "      <th>arrival_stop.location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>669路(金穗路总站(马场路口)--金穗路总站(马场路口))</td>\n",
       "      <td>900000105872</td>\n",
       "      <td>普通公交线路</td>\n",
       "      <td>3203</td>\n",
       "      <td>1872</td>\n",
       "      <td>113.344963,23.125919;113.344961,23.125920;113....</td>\n",
       "      <td>0</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>5</td>\n",
       "      <td>[{'name': '跑马地花园', 'id': '900000105872016', 'l...</td>\n",
       "      <td>国防大厦</td>\n",
       "      <td>900000105872002</td>\n",
       "      <td>113.344963,23.125919</td>\n",
       "      <td>猎德码头</td>\n",
       "      <td>900000105872006</td>\n",
       "      <td>113.337082,23.112673</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                             name            id    type distance duration  \\\n",
       "0  669路(金穗路总站(马场路口)--金穗路总站(马场路口))  900000105872  普通公交线路     3203     1872   \n",
       "\n",
       "                                            polyline bustimetag start_time  \\\n",
       "0  113.344963,23.125919;113.344961,23.125920;113....          0         []   \n",
       "\n",
       "  end_time via_num                                          via_stops  \\\n",
       "0       []       5  [{'name': '跑马地花园', 'id': '900000105872016', 'l...   \n",
       "\n",
       "  departure_stop.name departure_stop.id departure_stop.location  \\\n",
       "0                国防大厦   900000105872002    113.344963,23.125919   \n",
       "\n",
       "  arrival_stop.name  arrival_stop.id arrival_stop.location  \n",
       "0              猎德码头  900000105872006  113.337082,23.112673  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_669路_walking = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['walking']['steps'])\n",
    "_669路_bus = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['bus']['buslines'])\n",
    "_669路_walking\n",
    "_669路_bus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>跑马地花园</td>\n",
       "      <td>900000105872016</td>\n",
       "      <td>113.349510,23.123837</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>骏逸苑</td>\n",
       "      <td>900000105872003</td>\n",
       "      <td>113.348533,23.120226</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>花城大道</td>\n",
       "      <td>900000105872004</td>\n",
       "      <td>113.346390,23.117496</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>马场路南</td>\n",
       "      <td>900000105872015</td>\n",
       "      <td>113.343242,23.115239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>临江大道东</td>\n",
       "      <td>900000105872005</td>\n",
       "      <td>113.341801,23.112070</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name               id              location\n",
       "0  跑马地花园  900000105872016  113.349510,23.123837\n",
       "1    骏逸苑  900000105872003  113.348533,23.120226\n",
       "2   花城大道  900000105872004  113.346390,23.117496\n",
       "3   马场路南  900000105872015  113.343242,23.115239\n",
       "4  临江大道东  900000105872005  113.341801,23.112070"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_669路_bus_via_stops = pd.json_normalize(_669路_bus['via_stops'][0])\n",
    "_669路_bus_via_stops"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3.3 驾车\n",
    "> * B.driving_url:\t\n",
    "https://restapi.amap.com/v3/direction/driving?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，origin（出发点：经纬度）,destination（目的地：经纬度）\n",
    ">> * 选填：originid（出发点：poiid），destinationid（目的地：poiid），origintype，destinationtype\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 驾车路径规划 API 可以规划以小客车、轿车通勤出行的方案，并且返回通勤方案的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备\n",
    "wu_key = \"513aa007abc35c285a648025471ee1f1\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "from geo import driving"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'route': {'origin': '116.481028,39.989643',\n",
       "  'destination': '116.434446,39.90816',\n",
       "  'paths': [{'distance': '14415',\n",
       "    'duration': '1391',\n",
       "    'strategy': '速度最快',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'steps': [{'instruction': '向北行驶109米左转',\n",
       "      'orientation': '北',\n",
       "      'distance': '109',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '44',\n",
       "      'polyline': '116.48089,39.989371;116.480551,39.989605;116.480547,39.989657;116.480595,39.989705;116.481094,39.990048',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向东北行驶178米左转',\n",
       "      'orientation': '东北',\n",
       "      'distance': '178',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '44',\n",
       "      'polyline': '116.481094,39.990048;116.480816,39.990234;116.480803,39.990239;116.480781,39.990265;116.480781,39.990304;116.481246,39.990703;116.481363,39.990812;116.481428,39.990864;116.481823,39.991259',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向西北行驶14米右转',\n",
       "      'orientation': '西北',\n",
       "      'distance': '14',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '7',\n",
       "      'polyline': '116.481823,39.991259;116.48178,39.991293;116.48171,39.991354',\n",
       "      'action': '右转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿阜通东大街向东北行驶66米向右前方行驶进入右转专用道',\n",
       "      'orientation': '东北',\n",
       "      'road': '阜通东大街',\n",
       "      'distance': '66',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '15',\n",
       "      'polyline': '116.48171,39.991354;116.482209,39.991814',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': '进入右转专用道'},\n",
       "     {'instruction': '沿望京街向东行驶96米向右前方行驶进入辅路',\n",
       "      'orientation': '东',\n",
       "      'road': '望京街',\n",
       "      'distance': '96',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '24',\n",
       "      'polyline': '116.482209,39.991814;116.482339,39.99184;116.482444,39.991866;116.483338,39.991927',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': '进入辅路'},\n",
       "     {'instruction': '沿望京街向东南行驶97米向左前方行驶进入主路',\n",
       "      'orientation': '东南',\n",
       "      'road': '望京街',\n",
       "      'distance': '97',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '26',\n",
       "      'polyline': '116.483338,39.991927;116.483776,39.991632;116.484201,39.991359',\n",
       "      'action': '向左前方行驶',\n",
       "      'assistant_action': '进入主路'},\n",
       "     {'instruction': '沿望京街向东南行驶398米左转',\n",
       "      'orientation': '东南',\n",
       "      'road': '望京街',\n",
       "      'distance': '398',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '292',\n",
       "      'polyline': '116.484236,39.991337;116.48444,39.991311;116.484961,39.990972;116.485104,39.990872;116.485213,39.990807;116.485729,39.990469;116.486081,39.990234;116.486207,39.990152;116.486714,39.989809;116.487847,39.989076',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿京密路向东北行驶377米向右前方行驶进入匝道',\n",
       "      'orientation': '东北',\n",
       "      'road': '京密路',\n",
       "      'distance': '377',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '52',\n",
       "      'polyline': '116.48806,39.989054;116.488316,39.989262;116.489397,39.990234;116.48964,39.990447;116.490924,39.991645',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': '进入匝道'},\n",
       "     {'instruction': '沿S12机场高速入口途径S12机场高速向西南行驶2.3千米靠左沿主路行驶',\n",
       "      'orientation': '西南',\n",
       "      'road': 'S12机场高速入口',\n",
       "      'distance': '2312',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '150',\n",
       "      'polyline': '116.490924,39.991645;116.491089,39.991719;116.491159,39.99174;116.491215,39.991745;116.491276,39.991749;116.49135,39.991736;116.491398,39.991701;116.491463,39.991628;116.491484,39.991584;116.491493,39.99151;116.491484,39.991332;116.490286,39.990234;116.490074,39.990039;116.487986,39.988155;116.487465,39.987691;116.485534,39.985951;116.484453,39.98497;116.482691,39.983351;116.481415,39.982201;116.479518,39.980499;116.479141,39.980165;116.478116,39.979245;116.477049,39.978277;116.476645,39.977904;116.475734,39.977075;116.474588,39.976059',\n",
       "      'action': '靠左',\n",
       "      'assistant_action': '沿主路行驶'},\n",
       "     {'instruction': '沿S12机场高速向西南行驶4.7千米向右前方行驶进入匝道',\n",
       "      'orientation': '西南',\n",
       "      'road': 'S12机场高速',\n",
       "      'distance': '4662',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '237',\n",
       "      'polyline': '116.474588,39.976059;116.47263,39.974284;116.470412,39.972287;116.470161,39.972062;116.46885,39.970872;116.468481,39.970547;116.46691,39.969132;116.465937,39.96826;116.465703,39.968051;116.461727,39.96451;116.46056,39.963433;116.458359,39.961476;116.456997,39.960239;116.456102,39.959423;116.455078,39.958503;116.454787,39.958238;116.453971,39.9575;116.453724,39.957274;116.453516,39.957079;116.451775,39.955508;116.449783,39.953707;116.448993,39.952964;116.447899,39.951966;116.446489,39.95069;116.44602,39.95033;116.445668,39.950122;116.445469,39.950026;116.44513,39.949905;116.444592,39.949753;116.444258,39.949705;116.443971,39.949683;116.44329,39.94967;116.442244,39.949661;116.439761,39.949644;116.439644,39.949644;116.439266,39.94964;116.436793,39.949635;116.43556,39.949622',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': '进入匝道'},\n",
       "     {'instruction': '沿东直门北桥向西南行驶824米向左前方行驶',\n",
       "      'orientation': '西南',\n",
       "      'road': '东直门北桥',\n",
       "      'distance': '824',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '69',\n",
       "      'polyline': '116.43556,39.949622;116.434948,39.949683;116.434835,39.949705;116.434605,39.949779;116.434497,39.949822;116.434392,39.949887;116.434119,39.950065;116.433872,39.950213;116.433711,39.950282;116.433646,39.950308;116.433472,39.950343;116.433325,39.950352;116.433199,39.950343;116.433103,39.950317;116.433082,39.950308;116.433003,39.950273;116.432891,39.950213;116.432847,39.950178;116.432713,39.950048;116.432617,39.949905;116.432561,39.949796;116.432535,39.949701;116.432517,39.949601;116.432517,39.94951;116.43253,39.949405;116.432578,39.949253;116.432635,39.949132;116.4327,39.949028;116.432826,39.948885;116.432951,39.948754;116.433103,39.948581;116.43326,39.948368;116.433372,39.948125;116.43342,39.947973;116.43349,39.947704;116.433533,39.947474;116.43355,39.947409;116.433563,39.947183;116.433572,39.946931;116.43355,39.946289;116.43352,39.945326',\n",
       "      'action': '向左前方行驶',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿东直门北桥途径东二环向南行驶4.4千米向右前方行驶进入匝道',\n",
       "      'orientation': '南',\n",
       "      'road': '东直门北桥',\n",
       "      'distance': '4404',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '293',\n",
       "      'polyline': '116.43352,39.945326;116.433611,39.944796;116.433646,39.944644;116.433641,39.944076;116.433633,39.943728;116.433641,39.942656;116.433754,39.940204;116.433824,39.938186;116.433859,39.937452;116.433919,39.936254;116.433937,39.935742;116.433963,39.935299;116.434041,39.934084;116.43408,39.932752;116.434141,39.931445;116.434149,39.931068;116.434158,39.930794;116.434175,39.930286;116.434214,39.929536;116.434236,39.92898;116.434266,39.928299;116.434327,39.926914;116.43444,39.924314;116.434527,39.922339;116.434557,39.921654;116.434583,39.920968;116.434718,39.917977;116.434722,39.917747;116.434805,39.915968;116.434878,39.914466;116.434939,39.913863;116.434996,39.913507;116.43503,39.913329;116.435078,39.913047;116.435317,39.912031;116.43549,39.911328;116.435543,39.911007;116.435551,39.910951;116.435556,39.910894;116.435625,39.909744;116.435634,39.909171;116.435716,39.907405;116.435807,39.906493;116.435825,39.906107;116.435868,39.905803;116.435898,39.905603',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': '进入匝道'},\n",
       "     {'instruction': '沿东二环出口途径北京站东街向西行驶326米右转',\n",
       "      'orientation': '西',\n",
       "      'road': '东二环出口',\n",
       "      'distance': '326',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '42',\n",
       "      'polyline': '116.435898,39.905603;116.435838,39.905399;116.435812,39.905352;116.435794,39.905326;116.435755,39.905286;116.435664,39.905239;116.435486,39.905195;116.434805,39.905174;116.433529,39.905178;116.433329,39.905174;116.433103,39.905165;116.432378,39.905135',\n",
       "      'action': '右转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿大羊毛胡同向北行驶365米右转进入辅路',\n",
       "      'orientation': '北',\n",
       "      'road': '大羊毛胡同',\n",
       "      'distance': '365',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '59',\n",
       "      'polyline': '116.432378,39.905135;116.432309,39.905877;116.432313,39.906267;116.432313,39.906649;116.432305,39.906875;116.432266,39.907869;116.432248,39.908442',\n",
       "      'action': '右转',\n",
       "      'assistant_action': '进入辅路'},\n",
       "     {'instruction': '沿建国门内大街向东行驶187米到达目的地',\n",
       "      'orientation': '东',\n",
       "      'road': '建国门内大街',\n",
       "      'distance': '187',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '37',\n",
       "      'polyline': '116.432248,39.908442;116.432565,39.908381;116.433103,39.908377;116.43444,39.908394',\n",
       "      'action': [],\n",
       "      'assistant_action': '到达目的地'}],\n",
       "    'restriction': '0',\n",
       "    'traffic_lights': '3'}]}}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "driving(wu_key,'116.481028,39.989643','116.434446,39.90816')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3.4 骑行\n",
    "> * B.bicycling_url:\t\n",
    "https://restapi.amap.com/v4/direction/bicycling?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，origin（出发点：经纬度；值：116.434307,39.90909）,destination（目的地：经纬度；值：116.434446,39.90816）\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 骑行路径规划用于规划骑行通勤方案，规划时不会考虑路况；考虑天桥、单行线、封路等情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': {'destination': '116.434446,39.90816',\n",
       "  'origin': '116.434307,39.90909',\n",
       "  'paths': [{'distance': 216,\n",
       "    'duration': 52,\n",
       "    'steps': [{'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 54,\n",
       "      'duration': 13,\n",
       "      'instruction': '骑行54米右转',\n",
       "      'orientation': '',\n",
       "      'polyline': '116.434323,39.909041;116.434965,39.909041',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 114,\n",
       "      'duration': 27,\n",
       "      'instruction': '沿建国门北大街向南骑行114米右转',\n",
       "      'orientation': '南',\n",
       "      'polyline': '116.434965,39.909041;116.434931,39.908932;116.434887,39.908867;116.434887,39.908867;116.434818,39.908655;116.434826,39.908424;116.434883,39.908303;116.434883,39.908303;116.434974,39.908194;116.435009,39.908077',\n",
       "      'road': '建国门北大街',\n",
       "      'walk_type': 0},\n",
       "     {'action': '',\n",
       "      'assistant_action': '到达目的地',\n",
       "      'distance': 48,\n",
       "      'duration': 12,\n",
       "      'instruction': '骑行48米到达目的地',\n",
       "      'orientation': '',\n",
       "      'polyline': '116.435009,39.908073;116.434449,39.908073',\n",
       "      'road': '',\n",
       "      'walk_type': 0}]}]},\n",
       " 'errcode': 0,\n",
       " 'errdetail': None,\n",
       " 'errmsg': 'OK',\n",
       " 'ext': None}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.bicycling(wu_key,'116.434307,39.90909','116.434446,39.90816')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3.5 货车\n",
    "> * B.truck_url:\t\n",
    "https://restapi.amap.com/v4/direction/truck?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key，origin（出发点：经纬度；值：116.434307,39.90909）,destination（目的地：经纬度；值：116.434446,39.90816），size\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 了解货车限行状况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': {'route': {'destination': '116.434446,39.90816',\n",
       "   'origin': '116.434307,39.90909',\n",
       "   'paths': [{'distance': 1567,\n",
       "     'duration': 268,\n",
       "     'restriction': 0,\n",
       "     'steps': [{'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 23,\n",
       "       'duration': 8,\n",
       "       'instruction': '向西行驶23米右转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '116.434232,39.909067;116.434193,39.909089;116.433967,39.909089',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 23,\n",
       "         'polyline': '116.434232,39.909067;116.434193,39.909089;116.433967,39.909089',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 68,\n",
       "       'duration': 12,\n",
       "       'instruction': '向北行驶68米右转',\n",
       "       'orientation': '北',\n",
       "       'polyline': '116.433967,39.909089;116.433963,39.909705',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 68,\n",
       "         'polyline': '116.433967,39.909089;116.433963,39.909705',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 94,\n",
       "       'duration': 14,\n",
       "       'instruction': '向东北行驶94米右转',\n",
       "       'orientation': '东北',\n",
       "       'polyline': '116.433963,39.909705;116.43421,39.909722;116.434397,39.909787;116.434805,39.910035;116.434922,39.910104',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 82,\n",
       "         'polyline': '116.433963,39.909705;116.43421,39.909722;116.434397,39.909787;116.434805,39.910035',\n",
       "         'status': '未知'},\n",
       "        {'distance': 12,\n",
       "         'polyline': '116.434805,39.910035;116.434922,39.910104',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向左前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 202,\n",
       "       'duration': 49,\n",
       "       'instruction': '沿建国门北大街向南行驶202米向左前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '116.434922,39.910104;116.434965,39.909106;116.434948,39.908984;116.434883,39.908859;116.434813,39.90865;116.434831,39.90842;116.434878,39.908303',\n",
       "       'road': '建国门北大街',\n",
       "       'tmcs': [{'distance': 139,\n",
       "         'polyline': '116.434922,39.910104;116.434965,39.909106;116.434948,39.908984;116.434883,39.908859',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 63,\n",
       "         'polyline': '116.434883,39.908859;116.434813,39.90865;116.434831,39.90842;116.434878,39.908303',\n",
       "         'status': '缓行'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 349,\n",
       "       'duration': 52,\n",
       "       'instruction': '沿建国门南大街向南行驶349米右转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '116.434878,39.908303;116.43497,39.90819;116.435009,39.908099;116.43503,39.907951;116.435052,39.907452;116.435104,39.907214;116.435204,39.90697;116.435417,39.906619;116.435464,39.90651;116.435512,39.906345;116.43556,39.906016;116.435664,39.905239',\n",
       "       'road': '建国门南大街',\n",
       "       'tmcs': [{'distance': 208,\n",
       "         'polyline': '116.434878,39.908303;116.43497,39.90819;116.435009,39.908099;116.43503,39.907951;116.435052,39.907452;116.435104,39.907214;116.435204,39.90697;116.435417,39.906619;116.435464,39.90651',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 55,\n",
       "         'polyline': '116.435464,39.90651;116.435512,39.906345;116.43556,39.906016',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 86,\n",
       "         'polyline': '116.43556,39.906016;116.435664,39.905239',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 279,\n",
       "       'duration': 42,\n",
       "       'instruction': '沿北京站东街向西行驶279米右转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '116.435664,39.905239;116.435486,39.905195;116.434805,39.905174;116.433529,39.905178;116.433329,39.905174;116.433103,39.905165;116.432378,39.905135',\n",
       "       'road': '北京站东街',\n",
       "       'tmcs': [{'distance': 15,\n",
       "         'polyline': '116.435664,39.905239;116.435486,39.905195',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 58,\n",
       "         'polyline': '116.435486,39.905195;116.434805,39.905174',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 109,\n",
       "         'polyline': '116.434805,39.905174;116.433529,39.905178',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 16,\n",
       "         'polyline': '116.433529,39.905178;116.433329,39.905174',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 81,\n",
       "         'polyline': '116.433329,39.905174;116.433103,39.905165;116.432378,39.905135',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '进入辅路',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 365,\n",
       "       'duration': 58,\n",
       "       'instruction': '沿大羊毛胡同向北行驶365米右转进入辅路',\n",
       "       'orientation': '北',\n",
       "       'polyline': '116.432378,39.905135;116.432309,39.905877;116.432313,39.906267;116.432313,39.906649;116.432305,39.906875;116.432266,39.907869;116.432248,39.908442',\n",
       "       'road': '大羊毛胡同',\n",
       "       'tmcs': [{'distance': 82,\n",
       "         'polyline': '116.432378,39.905135;116.432309,39.905877',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 44,\n",
       "         'polyline': '116.432309,39.905877;116.432313,39.906267',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 41,\n",
       "         'polyline': '116.432313,39.906267;116.432313,39.906649',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 25,\n",
       "         'polyline': '116.432313,39.906649;116.432305,39.906875',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 109,\n",
       "         'polyline': '116.432305,39.906875;116.432266,39.907869',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 64,\n",
       "         'polyline': '116.432266,39.907869;116.432248,39.908442',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '',\n",
       "       'assistant_action': '到达目的地',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 187,\n",
       "       'duration': 33,\n",
       "       'instruction': '沿建国门内大街向东行驶187米到达目的地',\n",
       "       'orientation': '东',\n",
       "       'polyline': '116.432248,39.908442;116.432565,39.908381;116.433103,39.908377;116.43444,39.908394',\n",
       "       'road': '建国门内大街',\n",
       "       'tmcs': [{'distance': 187,\n",
       "         'polyline': '116.432248,39.908442;116.432565,39.908381;116.433103,39.908377;116.43444,39.908394',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0}],\n",
       "     'strategy': '避免拥堵',\n",
       "     'toll_distance': 0,\n",
       "     'tolls': 0,\n",
       "     'traffic_lights': 3},\n",
       "    {'distance': 1960,\n",
       "     'duration': 384,\n",
       "     'restriction': 0,\n",
       "     'steps': [{'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 67,\n",
       "       'duration': 16,\n",
       "       'instruction': '向西行驶67米右转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '116.434232,39.909067;116.434193,39.909089;116.433967,39.909089;116.433641,39.909089;116.433446,39.909132',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 23,\n",
       "         'polyline': '116.434232,39.909067;116.434193,39.909089;116.433967,39.909089',\n",
       "         'status': '未知'},\n",
       "        {'distance': 27,\n",
       "         'polyline': '116.433967,39.909089;116.433641,39.909089',\n",
       "         'status': '未知'},\n",
       "        {'distance': 17,\n",
       "         'polyline': '116.433641,39.909089;116.433446,39.909132',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 227,\n",
       "       'duration': 44,\n",
       "       'instruction': '沿贡院东街向北行驶227米左转',\n",
       "       'orientation': '北',\n",
       "       'polyline': '116.433446,39.909132;116.433446,39.909523;116.433451,39.909926;116.433446,39.910074;116.433442,39.910716;116.433429,39.911198',\n",
       "       'road': '贡院东街',\n",
       "       'tmcs': [{'distance': 43,\n",
       "         'polyline': '116.433446,39.909132;116.433446,39.909523',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 44,\n",
       "         'polyline': '116.433446,39.909523;116.433451,39.909926',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 16,\n",
       "         'polyline': '116.433451,39.909926;116.433446,39.910074',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 71,\n",
       "         'polyline': '116.433446,39.910074;116.433442,39.910716',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 53,\n",
       "         'polyline': '116.433442,39.910716;116.433429,39.911198',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 74,\n",
       "       'duration': 17,\n",
       "       'instruction': '沿贡院东街向西行驶74米右转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '116.433429,39.911198;116.433103,39.911194;116.432561,39.911189',\n",
       "       'road': '贡院东街',\n",
       "       'tmcs': [{'distance': 74,\n",
       "         'polyline': '116.433429,39.911198;116.433103,39.911194;116.432561,39.911189',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 103,\n",
       "       'duration': 27,\n",
       "       'instruction': '沿贡院东街向北行驶103米左转',\n",
       "       'orientation': '北',\n",
       "       'polyline': '116.432561,39.911189;116.432561,39.912122',\n",
       "       'road': '贡院东街',\n",
       "       'tmcs': [{'distance': 103,\n",
       "         'polyline': '116.432561,39.911189;116.432561,39.912122',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 478,\n",
       "       'duration': 127,\n",
       "       'instruction': '沿东总布胡同向西行驶478米左转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '116.432561,39.912122;116.431806,39.912114;116.431536,39.912114;116.430829,39.912109;116.430013,39.912153;116.429601,39.912153;116.428411,39.912135;116.42819,39.912144;116.426927,39.912122;116.426806,39.912127',\n",
       "       'road': '东总布胡同',\n",
       "       'tmcs': [{'distance': 64,\n",
       "         'polyline': '116.432561,39.912122;116.431806,39.912114',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 23,\n",
       "         'polyline': '116.431806,39.912114;116.431536,39.912114',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 60,\n",
       "         'polyline': '116.431536,39.912114;116.430829,39.912109',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 69,\n",
       "         'polyline': '116.430829,39.912109;116.430013,39.912153',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 35,\n",
       "         'polyline': '116.430013,39.912153;116.429601,39.912153',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 102,\n",
       "         'polyline': '116.429601,39.912153;116.428411,39.912135',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 18,\n",
       "         'polyline': '116.428411,39.912135;116.42819,39.912144',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 107,\n",
       "         'polyline': '116.42819,39.912144;116.426927,39.912122;116.426806,39.912127',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 398,\n",
       "       'duration': 77,\n",
       "       'instruction': '沿朝阳门南小街向南行驶398米左转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '116.426806,39.912127;116.426836,39.911749;116.426875,39.911393;116.426905,39.910998;116.42694,39.910239;116.426914,39.909622;116.426914,39.909201;116.426944,39.908529;116.42714,39.908346',\n",
       "       'road': '朝阳门南小街',\n",
       "       'tmcs': [{'distance': 41,\n",
       "         'polyline': '116.426806,39.912127;116.426836,39.911749',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 40,\n",
       "         'polyline': '116.426836,39.911749;116.426875,39.911393',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 128,\n",
       "         'polyline': '116.426875,39.911393;116.426905,39.910998;116.42694,39.910239',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 68,\n",
       "         'polyline': '116.42694,39.910239;116.426914,39.909622',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 46,\n",
       "         'polyline': '116.426914,39.909622;116.426914,39.909201',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 75,\n",
       "         'polyline': '116.426914,39.909201;116.426944,39.908529;116.42714,39.908346',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '进入辅路',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '110101', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 426,\n",
       "       'duration': 41,\n",
       "       'instruction': '沿建国门内大街向东行驶426米向右前方行驶进入辅路',\n",
       "       'orientation': '东',\n",
       "       'polyline': '116.42714,39.908346;116.42898,39.908372;116.42908,39.908372;116.429384,39.908381;116.429466,39.908385;116.430213,39.908403;116.431146,39.90842;116.432248,39.908442',\n",
       "       'road': '建国门内大街',\n",
       "       'tmcs': [{'distance': 157,\n",
       "         'polyline': '116.42714,39.908346;116.42898,39.908372;116.42908,39.908372',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 26,\n",
       "         'polyline': '116.42908,39.908372;116.429384,39.908381',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 6,\n",
       "         'polyline': '116.429384,39.908381;116.429466,39.908385',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 64,\n",
       "         'polyline': '116.429466,39.908385;116.430213,39.908403',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 79,\n",
       "         'polyline': '116.430213,39.908403;116.431146,39.90842',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 94,\n",
       "         'polyline': '116.431146,39.90842;116.432248,39.908442',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '',\n",
       "       'assistant_action': '到达目的地',\n",
       "       'cities': [{'adcode': '110101',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 187,\n",
       "       'duration': 35,\n",
       "       'instruction': '沿建国门内大街向东行驶187米到达目的地',\n",
       "       'orientation': '东',\n",
       "       'polyline': '116.432248,39.908442;116.432565,39.908381;116.433103,39.908377;116.43444,39.908394',\n",
       "       'road': '建国门内大街',\n",
       "       'tmcs': [{'distance': 187,\n",
       "         'polyline': '116.432248,39.908442;116.432565,39.908381;116.433103,39.908377;116.43444,39.908394',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0}],\n",
       "     'strategy': '避免拥堵',\n",
       "     'toll_distance': 0,\n",
       "     'tolls': 0,\n",
       "     'traffic_lights': 3}]},\n",
       "  'count': 2},\n",
       " 'errcode': 0,\n",
       " 'errdetail': None,\n",
       " 'errmsg': 'OK',\n",
       " 'ext': None}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.truck(wu_key,'116.434307,39.90909','116.434446,39.90816',1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.4 行政区域查询\n",
    "> * 行政区域查询是一类简单的HTTP接口，根据用户输入的搜索条件可以帮助用户快速的查找特定的行政区域信息\n",
    "\n",
    "> * url:https://restapi.amap.com/v3/config/district?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 可根据用户输入的搜索条件可以帮助用户快速的查找特定的行政区域信息\n",
    "- 用户希望通过得到行政区域信息，进行开发工作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'suggestion': {'keywords': [], 'cities': []},\n",
       " 'districts': [{'citycode': '0663',\n",
       "   'adcode': '445200',\n",
       "   'name': '揭阳市',\n",
       "   'center': '116.355733,23.543778',\n",
       "   'level': 'city',\n",
       "   'districts': [{'citycode': '0663',\n",
       "     'adcode': '445281',\n",
       "     'name': '普宁市',\n",
       "     'center': '116.165082,23.29788',\n",
       "     'level': 'district',\n",
       "     'districts': []},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445222',\n",
       "     'name': '揭西县',\n",
       "     'center': '115.838708,23.4273',\n",
       "     'level': 'district',\n",
       "     'districts': []},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445224',\n",
       "     'name': '惠来县',\n",
       "     'center': '116.295832,23.029834',\n",
       "     'level': 'district',\n",
       "     'districts': []},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445202',\n",
       "     'name': '榕城区',\n",
       "     'center': '116.357045,23.535524',\n",
       "     'level': 'district',\n",
       "     'districts': []},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445203',\n",
       "     'name': '揭东区',\n",
       "     'center': '116.412947,23.569887',\n",
       "     'level': 'district',\n",
       "     'districts': []}]}]}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.district (wu_key,'揭阳','1')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.5 搜索POI\n",
    "> * 搜索服务API是一类简单的HTTP接口，提供多种查询POI信息的能力，其中包括关键字搜索、周边搜索、多边形搜索、ID查询四种筛选机制\n",
    "\n",
    "> * url:https://restapi.amap.com/v3/place/text?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,keywords,types(keywords和types两者至少必选其一)\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 提供多种查询POI信息的能力\n",
    "- 关键字搜索：通过用POI的关键字进行条件搜索，例如：肯德基、朝阳公园等；同时支持设置POI类型搜索，例如：银行\n",
    "- 周边搜索：在用户传入经纬度坐标点附近，在设定的范围内，按照关键字或POI类型搜索；\n",
    "- 多边形搜索：在多边形区域内进行搜索\n",
    "- ID查询：通过POI ID，查询某个POI详情，建议可同输入提示API配合使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '154',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院',\n",
       "   'location': '113.679262,23.632583',\n",
       "   'tel': '020-61787331',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140MR9A'},\n",
       "  {'parent': 'B0FFMCZOK0',\n",
       "   'address': '温泉大道882',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(西北门)',\n",
       "   'location': '113.672109,23.643371',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141JCWL'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院',\n",
       "   'location': '113.671493,23.643831',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFMCZOK0'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道886号中山大学南方学院内',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;学校',\n",
       "   'photos': [],\n",
       "   'typecode': '141200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-综合楼',\n",
       "   'location': '113.680117,23.631544',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFF2VMJ4'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '中山路',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院音乐系',\n",
       "   'location': '113.678792,23.635389',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKPXMCN'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(东南门)',\n",
       "   'location': '113.678733,23.628290',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFK8J7XY'},\n",
       "  {'parent': 'B0FFMCZOK0',\n",
       "   'address': '温泉大道882',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(正门)',\n",
       "   'location': '113.671663,23.643941',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G06MOP96'},\n",
       "  {'parent': [],\n",
       "   'address': '神岗镇',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;小学',\n",
       "   'photos': [],\n",
       "   'typecode': '141203',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院附属小学',\n",
       "   'location': '113.522758,23.473157',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLA7KQW'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路4附近',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院西区饭堂',\n",
       "   'location': '113.676210,23.632177',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJLW0O9'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;学校',\n",
       "   'photos': [],\n",
       "   'typecode': '141200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-综合楼',\n",
       "   'location': '113.677892,23.628958',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLFILKM'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼9号',\n",
       "   'location': '113.679747,23.633032',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLFIY0N'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路21',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼2号',\n",
       "   'location': '113.677060,23.631346',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TRVH'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼10号',\n",
       "   'location': '113.680125,23.633492',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFTC9PH'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-第11教学楼',\n",
       "   'location': '113.680037,23.633173',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJKIA10'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼8号',\n",
       "   'location': '113.680399,23.634329',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141WQCO'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路7',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼7号',\n",
       "   'location': '113.678600,23.633330',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TQGR'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路29',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼4号',\n",
       "   'location': '113.677460,23.630490',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TR76'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号中山大学南方学院新综合楼二楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院达人书院',\n",
       "   'location': '113.679041,23.632392',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFM4JIF8'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路附近',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院1号实验楼',\n",
       "   'location': '113.678215,23.631370',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKP9ET5'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉镇博学路中山大学南方学院9号教学楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-政商研究院',\n",
       "   'location': '113.680427,23.633994',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL9B0QY'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 关键字搜索\n",
    "geo.poi_text(wu_key,\"中山大学南方学院\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '839',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'type': '生活服务;共享设备;充电宝',\n",
       "   'photos': [],\n",
       "   'typecode': '072101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '街电(榴芒一族中山大学南方学院店)',\n",
       "   'location': '113.679287,23.632575',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLB846S'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院博学路6号',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '爽爽石磨肠粉',\n",
       "   'location': '113.679287,23.632575',\n",
       "   'tel': '18218913303',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKX3T5Y'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院明辨路2号二、三层',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '避风塘',\n",
       "   'location': '113.679286,23.632574',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKT2R96'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院明辨路2号二、三层',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': 'slim tea',\n",
       "   'location': '113.679286,23.632574',\n",
       "   'tel': '18944690066',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKSLFAN'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '劲酷烤吧',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13719231627',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3AYBO5X'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;中餐厅;广东菜(粤菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050103',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '东记乡村美食',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13922398107',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3APADKJ'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '北方饺子馆',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13434241448',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2Z7IX80'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '第1烤场',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13538825321',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2K6PX0X'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '叶龙老武汉烧烤',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '15918718710;13125030232',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G1393J7X'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院明辩路2号',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '网红小串店',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13802426981',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLNRH1K'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '过气轻食屋',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13049636920',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKTDMOI'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '莫凡烧烤',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13929768267',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKT4WNY'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号旁润泰超市一楼商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;冷饮店;冷饮店',\n",
       "   'photos': [],\n",
       "   'typecode': '050700',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': 'LV柠檬茶',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '15018428578',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIIQNQ7'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;甜品店;甜品店',\n",
       "   'photos': [],\n",
       "   'typecode': '050900',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '味美轩(中大店)',\n",
       "   'location': '113.679286,23.632571',\n",
       "   'tel': '15915874513',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2T96S9V'},\n",
       "  {'parent': [],\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': '0',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;中餐厅;四川菜(川菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050102',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '重庆湖边纸包鱼',\n",
       "   'location': '113.679871,23.630292',\n",
       "   'tel': '13924024938',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL7NUA2'},\n",
       "  {'parent': [],\n",
       "   'address': '博学路中山大学南方学院后门润泰超市首层23号',\n",
       "   'distance': '1',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '我家厨房',\n",
       "   'location': '113.679289,23.632563',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFK28XPU'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': '2',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'type': '生活服务;共享设备;充电宝',\n",
       "   'photos': [],\n",
       "   'typecode': '072101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '怪兽充电(中山大学南方学院)',\n",
       "   'location': '113.679262,23.632583',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLLU813'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇博学路中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '9',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;外国餐厅;日本料理',\n",
       "   'photos': [],\n",
       "   'typecode': '050202',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '井禾寿司',\n",
       "   'location': '113.679193,23.632552',\n",
       "   'tel': '13789117723',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G14PDQVA'},\n",
       "  {'parent': [],\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': '12',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'photos': [],\n",
       "   'typecode': '050201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': 'Uni-hotel西餐',\n",
       "   'location': '113.679224,23.632671',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0GR3OMDZ2'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院明辩路2号',\n",
       "   'distance': '16',\n",
       "   'biz_ext': [],\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'type': '餐饮服务;中餐厅;广东菜(粤菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050103',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'name': '耀记美食',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': '18816801934',\n",
       "   'shopid': [],\n",
       "   'id': 'B0GRGOTLSL'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 周边搜索\n",
    "geo.poi_around(wu_key,'113.679287,23.632575')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '0',\n",
       " 'infocode': '10000',\n",
       " 'pois': [],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 多边形搜索\n",
    "geo.poi_polygon(wu_key,\"116.460988,40.006919|116.48231,40.007381;116.47516,39.99713|116.472596,39.985227|116.45669,39.984989|116.460988,40.006919\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'count': '1',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': 'B00140MR9A',\n",
       "   'distance': [],\n",
       "   'pcode': '440000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '商务住宅;住宅区;宿舍',\n",
       "   'photos': [],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '3513355422',\n",
       "   'typecode': '120303',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'deep_info': {'deepsrc': []},\n",
       "   'citycode': '020',\n",
       "   'adname': '从化区',\n",
       "   'indoor_src': [],\n",
       "   'children': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFGXGN3K',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': [],\n",
       "   'indoor_map': '0',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-09-18 23:29:57',\n",
       "   'website': [],\n",
       "   'address': '中山大学南方学院',\n",
       "   'adcode': '440117',\n",
       "   'pname': '广东省',\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': [],\n",
       "   'indoor_data': {'cmsid': [], 'truefloor': [], 'cpid': [], 'floor': []},\n",
       "   'childtype': '309',\n",
       "   'rich_content': [],\n",
       "   'exit_location': [],\n",
       "   'name': '中山大学南方学院宿舍H25',\n",
       "   'location': '113.683474,23.632020',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': [],\n",
       "   'groupbuy_num': '0'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ID查询\n",
    "geo.poi_id(wu_key,\"B0FFGXGN3K\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.6 IP定位\n",
    "> * IP定位是一个简单的HTTP接口，根据用户输入的IP地址，能够快速的帮用户定位IP的所在位置\n",
    "\n",
    "> * url:https://restapi.amap.com/v3/ip?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 能够快速的帮用户定位IP的所在位置\n",
    "- 能够将IP信息转换为地理位置信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'province': '北京市',\n",
       " 'city': '北京市',\n",
       " 'adcode': '110000',\n",
       " 'rectangle': '116.0119343,39.66127144;116.7829835,40.2164962'}"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.ip(wu_key,'114.247.50.2')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.7 静态地图\n",
    "> * 静态地图服务通过返回一张地图图片响应HTTP请求，使用户能够将高德地图以图片形式嵌入自己的网页中。用户可以指定请求的地图位置、图片大小、以及在地图上添加覆盖物，如标签、标注、折线、多边形\n",
    "\n",
    "> * url:\t\n",
    "https://restapi.amap.com/v3/staticmap?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,zoom,location,(部分条件必填)\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 静态地图服务通过返回一张地图图片响应HTTP请求，使用户能够将高德地图以图片形式嵌入自己的网页中\n",
    "- 用户可以指定请求的地图位置、图片大小、以及在地图上添加覆盖物，如标签、标注、折线、多边形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAADAFBMVEX29fH59/H68u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j7uIw2B8nCgXQQgCxiyOQXhsxZBce3DW3PK15eW/fR+EL57rutL8q2SMkfNCFVpTl5bEtRZuaR3tOpGWHbssf+UUtJAQicEs3C7g+f8jbjRIKXx6FgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<PIL.PngImagePlugin.PngImageFile image mode=P size=400x400 at 0x16038B5CF70>"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 中山大学南方学院\n",
    "geo.staticmap(wu_key,\"113.672109,23.643371\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.8 坐标转换\n",
    "> * 坐标转换是一类简单的HTTP接口，能够将用户输入的非高德坐标（GPS坐标、mapbar坐标、baidu坐标）转换成高德坐标\n",
    "\n",
    "> * url:\t\n",
    "https://restapi.amap.com/v3/assistant/coordinate/convert?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,locations\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 能够将用户输入的非高德坐标转换成高德坐标\n",
    "- 为了使用高德服务，用户需要将非高德坐标转换为高德坐标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'locations': '113.683474,23.632020'}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.coordinate_convert(wu_key,'113.683474,23.632020')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  2.9 天气查询\n",
    "> * 天气查询是一个简单的HTTP接口，根据用户输入的adcode，查询目标区域当前/未来的天气情况\n",
    "\n",
    "> * url:\t\n",
    "https://restapi.amap.com/v3/weather/weatherInfo?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,city\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 查询目标区域当前/未来的天气情况\n",
    "- 需要使用相关天气查询的时候"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'forecasts': [{'city': '揭阳市',\n",
       "   'adcode': '445200',\n",
       "   'province': '广东',\n",
       "   'reporttime': '2020-11-18 00:22:42',\n",
       "   'casts': [{'date': '2020-11-17',\n",
       "     'week': '2',\n",
       "     'dayweather': '多云',\n",
       "     'nightweather': '多云',\n",
       "     'daytemp': '29',\n",
       "     'nighttemp': '20',\n",
       "     'daywind': '东南',\n",
       "     'nightwind': '东南',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-18',\n",
       "     'week': '3',\n",
       "     'dayweather': '多云',\n",
       "     'nightweather': '多云',\n",
       "     'daytemp': '28',\n",
       "     'nighttemp': '22',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-19',\n",
       "     'week': '4',\n",
       "     'dayweather': '阴',\n",
       "     'nightweather': '小雨',\n",
       "     'daytemp': '27',\n",
       "     'nighttemp': '22',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'},\n",
       "    {'date': '2020-11-20',\n",
       "     'week': '5',\n",
       "     'dayweather': '阴',\n",
       "     'nightweather': '小雨',\n",
       "     'daytemp': '27',\n",
       "     'nighttemp': '21',\n",
       "     'daywind': '北',\n",
       "     'nightwind': '北',\n",
       "     'daypower': '≤3',\n",
       "     'nightpower': '≤3'}]}]}"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.weather(wu_key,'揭阳')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  输入提示\n",
    "> * 输入提示是一类简单的HTTP接口，提供根据用户输入的关键词查询返回建议列表\n",
    "\n",
    "> * url:\t\n",
    "https://restapi.amap.com/v3/assistant/inputtips?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,keywords\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 供根据用户输入的关键词查询返回建议列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '10',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'tips': [{'id': [],\n",
       "   'name': '肯德基',\n",
       "   'district': [],\n",
       "   'adcode': [],\n",
       "   'location': [],\n",
       "   'address': [],\n",
       "   'typecode': [],\n",
       "   'city': []},\n",
       "  {'id': 'B0GU3LJM7A',\n",
       "   'name': '肯德基',\n",
       "   'district': '广东省广州市越秀区',\n",
       "   'adcode': '440104',\n",
       "   'location': '113.295368,23.124743',\n",
       "   'address': [],\n",
       "   'typecode': '050300',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFMDO7PX',\n",
       "   'name': '肯德基',\n",
       "   'district': '广东省广州市海珠区',\n",
       "   'adcode': '440105',\n",
       "   'location': '113.312700,23.100720',\n",
       "   'address': '金菊路10号万宜华轩首层',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B0G304H07E',\n",
       "   'name': '肯德基',\n",
       "   'district': '广东省广州市番禺区',\n",
       "   'adcode': '440113',\n",
       "   'location': '113.325686,22.960360',\n",
       "   'address': '钟村街道广东广州市番禺区城区祈福新村祈福缤纷汇7栋',\n",
       "   'typecode': '050300',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFHZAQU0',\n",
       "   'name': '肯德基',\n",
       "   'district': '广东省广州市白云区',\n",
       "   'adcode': '440111',\n",
       "   'location': '113.328485,23.191150',\n",
       "   'address': '京溪南方医院地铁D出口天州广场2楼',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFGHHGY2',\n",
       "   'name': '肯德基(清湖店)',\n",
       "   'district': '广东省广州市白云区',\n",
       "   'adcode': '440111',\n",
       "   'location': '113.272307,23.256981',\n",
       "   'address': '均禾大道清湖段金铂广场1-2层',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B00141J8OS',\n",
       "   'name': '肯德基(上社店)',\n",
       "   'district': '广东省广州市天河区',\n",
       "   'adcode': '440106',\n",
       "   'location': '113.367587,23.132552',\n",
       "   'address': '中山大道西上社博兴购物广场2层(近天河公园北门)',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B00141IEYF',\n",
       "   'name': '肯德基(沙步店)',\n",
       "   'district': '广东省广州市黄埔区',\n",
       "   'adcode': '440112',\n",
       "   'location': '113.526104,23.085144',\n",
       "   'address': '沙步村沙步生活区市场商业街三路壹栋黄埔东路2841号',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B00141IEYA',\n",
       "   'name': '肯德基(淘金店)',\n",
       "   'district': '广东省广州市越秀区',\n",
       "   'adcode': '440104',\n",
       "   'location': '113.287706,23.139518',\n",
       "   'address': '淘金路淘金街6-8号1楼(世贸大厦后面)',\n",
       "   'typecode': '050301',\n",
       "   'city': []},\n",
       "  {'id': 'B00141IEMR',\n",
       "   'name': '肯德基(钟村店)',\n",
       "   'district': '广东省广州市番禺区',\n",
       "   'adcode': '440113',\n",
       "   'location': '113.315647,22.978454',\n",
       "   'address': '钟村镇钟灵北路2号旁天汇百货商场1-2层',\n",
       "   'typecode': '050300',\n",
       "   'city': []}]}"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "geo.inputtips(wu_key,\"肯德基\",city=\"广州\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  交通态势\n",
    "> * 交通态势是一类简单的HTTP接口，提供根据用户输入的内容能够返回希望查询的交通态势情况\n",
    "\n",
    "> * url:https://restapi.amap.com/v3/traffic/status/rectangle?parameters\n",
    "\n",
    "> * C.关于request参数：\n",
    "\n",
    ">> * 必填：key,rectangle\n",
    "\n",
    "> * D.requests.get()\n",
    "\n",
    "##### 产品应用方案或场景\n",
    "- 根据用户输入的内容能够返回希望查询的交通态势情况\n",
    "- 希望能够确定矩形、圆形或某条道路的交通态势情况，路况信息2分钟更新一次"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': '513aa007abc35c285a648025471ee1f1',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 矩形区域交通态势\n",
    "geo.traffic_rectangle(wu_key,'116.351147,39.966309;116.357134,39.968727')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': '513aa007abc35c285a648025471ee1f1',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 圆形区域交通态势\n",
    "geo.traffic_circle(wu_key,'113.683474,23.632020')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': '513aa007abc35c285a648025471ee1f1',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 指定线路交通态势\n",
    "geo.traffic_road(wu_key,'温泉大道','从化')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
